//是否包含中文 public static boolean isContainChinese(String str) { Pattern p = Pattern.compile("[\\u4e00-\\u9fa5]"); Matcher m = p.matcher(str); if (m.find()) { return true; } return false; }
Android 中 判断某个字段是否包含中文
最新推荐文章于 2024-08-05 03:38:56 发布
本文提供了一个实用的Java方法,用于检测给定的字符串中是否包含中文字符。通过正则表达式匹配一到龥之间的Unicode编码来实现。
2155

被折叠的 条评论
为什么被折叠?



