check string whether it is a palindrome or not