how to make my program check if its a palindrome by ignoring non-alpha characters and white spaces : <p>Hi this code currently checks if it is a palindrome if there all the letters are same capitalization and if there is no spaces. I am trying to make it so it ignores non-alpha and white spaces.  </p>

<pre><code>import java.util.*;

public class PalindromeTester
{
   public static void main(String args[])
   {
      String original, reverse = "";
      Scanner in = new Scanner(System.in);

      System.out.println("Enter a string to check if it is a palindrome");
      original = in.nextLine();

      int length = original.length();

      for ( int i = length - 1; i &gt;= 0; i-- )
         reverse = reverse + original.charAt(i);

      if (original.equals(reverse))
         System.out.println("Entered string is a palindrome.");
      else
         System.out.println("Entered string is not a palindrome.");

   }
}
</code></pre>
