title: Find a character or group of characters in a string and remove them
body: <p>I am trying to build a program that</p>
  
  <ol>
  <li>locates the <code>@</code> symbol, then</li>
  <li>locates the <code>.edu</code> part of an educational email address, and finally</li>
  <li>removes the <code>@school.edu</code> section, and return the rest.</li>
  </ol>
  
  <p>I've tried using <code>charAt</code>, but I keep receiving an incompatible-types error, and I'm not sure how to remove a section of a string that could be in a different location each time. Any guidance would be welcome.</p>
  
  <p>here is what I have so far:</p>
  
  <pre><code>if (UserEmail.charAt(0) == (".edu"))
  String UserName = UserEmail.substring(0,//location of @//)
  
  else 
  System.out.print(UserEmail + "is not an acceptable email address.
  System.out.print("Type your email address.");
  UserEmail = kb.nextLine();
  </code></pre>