Removing inserted numbers from a String in java
<p>Ok, so i have created a program that defines if the inserted word is a palindrome or not. 
But i need help on removing numbers that where to be inserted in the string.</p>

<pre><code>import java.util.*;
import java.util.Scanner;
class Palindrome
{
   public static void main(String args[])
   {
      String reverse = "";
      Scanner scan = new Scanner(System.in);
      System.out.print("Type a sentence and press enter: ");
      String input = scan.nextLine();
      // use regex to remove the punctuation and spaces
      String Input = input.replaceAll("\\W", " ");
      System.out.println(Input);

      int length = input.length();

      for ( int i = length - 1 ; i &gt;= 0 ; i-- )
         reverse = reverse.replaceAll("\\W", "") + input.charAt(i);   
      System.out.println(reverse);

      if (input.equals(reverse))
         System.out.println("Entered string is a palindrome.");
      else
        System.out.println("Entered string is not a palindrome.");
   }
}
</code></pre>
