Utility method to check if substring from low to high is palindrome or not .
static bool isPalindrome ( string str , int low , int high ) { while ( low < high ) { if ( str [ low ] != str [ high ] ) return false ; low ++ ; high -- ; } return true ; }