public boolean isChinese(String aa){
char [] cha = aa.toCharArray();
for(int i =0;i<cha.length;i++){
if(cha[i] >= 0x4e00 && cha[i] <= 0x9fbb){
return true;
}
}
return false;
}
@Test
public void testChinese(){
String aa = "ä¸æabc";
String bb = "ABC";
boolean a = isChinese(aa);
boolean b = isChinese(bb);
if(a){
System.out.println("å«æä¸æ");
}else{
System.out.println("没æä¸æ");
}
}
温馨提示:答案为网友推荐,仅供参考