<p><strong>Definition:</strong></p>

<p><em>A palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction</em></p>

<p>How to check if the given string is a palindrome?</p>

<p>This was one of the FAIQ [Frequently Asked Interview Question] a while ago but that mostly using C.</p>

<p>Looking for solutions in any and all languages possible.</p>

```
```
boolean isPalindrome(String str1) {
  //first strip out punctuation and spaces
  String stripped = str1.replaceAll("[^a-zA-Z0-9]", "");
  return stripped.equalsIgnoreCase((new StringBuilder(stripped)).reverse().toString());
}
```
```
Java version