java判断是否为汉字
java判断是否为汉字
public static boolean isChinese(String str) { String regEx = "[\u4e00-\u9fa5]"; Pattern pat = Pattern.compile(regEx); Matcher matcher = pat.matcher(str); boolean flg = false; if (matcher.find()) flg = true; return flg; }
看完打开支付宝扫一扫领个红包吧!