public static boolean isChinese(String name) {
Pattern p = Pattern.compile("[\u4e00-\u9fa5]");
Matcher m = p.matcher(name);
if (m.find()) {
return true;
}
return false;
}
判断是否包含中文
最新推荐文章于 2024-04-15 10:46:34 发布
public static boolean isChinese(String name) {
Pattern p = Pattern.compile("[\u4e00-\u9fa5]");
Matcher m = p.matcher(name);
if (m.find()) {
return true;
}
return false;
}