https://meilishiyan-song.taobao.com/

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);

posted @ 2017-03-28 10:37  望梦圆  阅读(7527)  评论(0编辑  收藏  举报
https://meilishiyan-song.taobao.com/