How can we find a palindrome within a string?
Of course, every letter is a one letter palindrome - so let's assume you are looking for a palindrome that is at least two letters long.

If your goal is just to find any palindrome in a string $\{a_i\}$(rather than finding all palindromes or finding the longest palindrome, for example) then you only need to consider two cases:

1) If $a_n=a_{n+1}$ for any $n$ then you have found a two letter palindrome.

2) If $a_n=a_{n+2}$ for any $n$ then you have found a three letter palindrome.

Any longer palindrome must contain a two or a three letter palindrome as a substring.