Add isPalindrome Method

Check if the string is a palindrome.