public class Palindrome {
public static boolean isSentencePalindrome(String str) {
// Change the string into lowercase and remove all non-alphanumeric characters
str = str.toLowerCase().replaceAll("[^a-zA-Z0-9]", "");
return str.equals(new StringBuilder(str).reverse().toString());
}
public static void main(String args[]) {
System.out.println(isSentencePalindrome("Top step's pup's pet spot.") ? "yes": "no");
}
}
/*
run:
yes
*/