In java It can be like this
// lets take testString="SAS"boolean isPalindrome(String testString){int length=testString.length();for(int i=0;i<length/2;i++) if(testString[i]!=testString[length-i+1]) return false;//else it's palindromereturn true;}
Hope this works faster