java string 去除所有特殊符号

String s = "Loadin/Fillin";
char[] chars = s.toCharArray();
StringBuffer buffer=new StringBuffer();
for(int i = 0; i < chars.length; i ++) {
if((chars[i] >= 19968 && chars[i] <= 40869) || (chars[i] >= 97 && chars[i] <= 122) || (chars[i] >= 65 && chars[i] <= 90)) {

buffer.append(chars[i]);
}
}
System.out.print("buffer="+buffer);

转载于:https://www.cnblogs.com/songyunxinQQ529616136/p/6632549.html

你可能感兴趣的:(java string 去除所有特殊符号)