Utility method to check if substring from low to high is palindrome or not .
function isPalindrome ( str , low , high ) { while ( low < high ) { if ( str . charAt ( low ) != str . charAt ( high ) ) return false ; low ++ ; high -- ; } return true ; }