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);
}
}
}
}
java中判断字符串中是否有中文字符
最新推荐文章于 2024-03-27 10:06:22 发布