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;
}
微信小程序学习资料