java中判断字符串中是否有中文字符

package com.meritit.test;

public class TestChart {
	 public static void main(String[] args) throws Exception {
	        String aa = "中国China人";
	        for (int i = 0; i < aa.length(); i++) {
	            String bb = aa.substring(i, i + 1);
	            boolean cc = java.util.regex.Pattern.matches("[u4E00-u9FA5]", bb);
	            if (cc) {
	                System.out.println(bb);
	            }
	        }
	 }
}



原文地址:https://www.cnblogs.com/lanzhi/p/6469861.html