Java检测字符串是否是回文字符串的代码

如下代码内容是关于Java检测字符串是否是回文字符串的代码。

public static boolean isPalindrome(String s){
int low = 0;
int high = s.length()-1;
while(low < high){
if(s.charAt(low)!=s.charAt(high)){
return false;
}
low ++;
high --;
}
return true;
}

 

posted @ 2020-06-03 13:33  wezah05  阅读(119)  评论(0)    收藏  举报