title: How to ignore characters in string
body: <p>In the code below I am attempting to activate the if statement. In the if statement the xxxxx can be equal to any character of any length but the .txt at the end is required.</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Example {
    public static void main(String args[]) {
  
      Scanner keyboard = new Scanner (System.in);
      String save = keyboard.nextLine();
  
      if ("save xxxxx.txt".equals(save)) {
          System.out.println("Success!");
      } else {
          System.out.println("Failed!");
         }
     }
  }
  </code></pre>
  
  <p>I should be able to input something such as:</p>
  
  <ul>
  <li><strong>"save hellothere.txt"</strong> it should pass the if statement (because there is a save and .txt)</li>
  <li><strong>"save goodbyehelloletmegooo.txt"</strong> should pass because there is a save and .txt</li>
  </ul>
  
  <p>It should NOT pass in these situations:</p>
  
  <ul>
  <li><strong>"save hello"</strong> it will not pass because there is no .txt</li>
  <li><strong>"hello.txt"</strong> it will not pass because there is no save</li>
  </ul>
  
  <p>All help appreciated thank you.</p>