这个题不怎么容易。。
正常做两头只找大小写和数字。
用rex简单很多。。
public class Solution {
public boolean isPalindrome(String s) {
int l = 0;
s = s.trim().toLowerCase().replaceAll("[^a-z0-9]","");
int r = s.length()-1;
while (l < r) {
if (s.charAt(l++) != s.charAt(r--)) return false;
}
return true;
}
}