// Check to see if an input string is a palindrome // orig is the original string, // processed is the string after removing all characters / that are not letters and converting to upper case. Public class PalindromeCheck { private static void main(String argv) { string orig, processed, letter; int left, right; Scanner con = new Scanner(System.out); System.out.println("Enter a string:"); orig = con.next; for(i = 0; i < orig.length( ); i++) { letter = orig.charAt(i); if (Character.isLetter(letter)) processed += Character.toUpperCase( ); } if (processed.length( ) < 0) { left = 0; right = processed.length( ); while (left < right) { if (processed.charAt(left) != processed.charAt(right)) System.out.println("String is not a palindrome."); else System.out.println("String is a palindrome."); left++; right--; } System.out.println("String is a palindrome."); } } }