以下是一段筛选中文字符的代码,写出来没人欣赏,故放到网上供大学学习。
public class SeekChineseCode {
public static void main(String[] args) {
String s = "fjk我d;是sa中fj国k;ew$%^人&";
char[] c = new char[s.length()];
int len = c.length;
System.out.println(len);
s.getChars(0,len,c,0);
for(int i=0;i<c.length;i++){
int j=c[i];
if(j>128){
char d = (char)j;
System.out.println(d);
}
}
}
}