Hi everybody. I appreciate any help given, and appreciate your time. I'm currently doing a program that tests if the input is a palindrome or not. I have already done the reversing part of the program. But was wondering how I could possibly check to see if the input word is a palindrome. Here's what I have done so far, thanks a lot. Any advice is appreciated.
private void reversePalindrome()
{
String palindrome="";
char[] array=palindrome.toCharArray();
char[] carol=new char[palindrome.length()];
for(int i=array.length-1, j=0; i>=0; i--, j++)
{
carol[j]=array[i];
}
System.out.println(carol);
}
Since I have to consider punctuation too, I have thought of converting the input into a string tokenizer. Would this help to check for palindronism?