I want to write a java method to return true if the string is a palindrome.
Here is what I still have:
String palindrome = "..."; boolean isPalindrome = palindrome.equals( new StringBuilder(palindrome).reverse().toString());
My problem is that he does not consider a word like: Race car palindrome.
Doc, note, I dissent. A fast never prevents a fatness. I diet on cod.
What is the best way to check if it is a palindrome, with case insensitive and ignoring punctuation.
source share