java判断字符串中的中文
public class TestCN {
public static void main(String args[]) {
String s = "asdf你好哈哈哦哦qwer";
// Pattern p = Pattern.compile("[\u4E00-\u9FA5]") ;
//U+4e00 ~ U+9FB0
Pattern p1 = Pattern.compile("[\u4E00-\u9FB0]") ;
Matcher m = p1.matcher(s) ;
while(m.find()) {
System.out.println(m.group());
}
}
}