Of course, you could avoid erasing the string, and just call the next level of isPalindrome() with instring.substr(2, length-2)

--
Mats