Pattern p = Pattern.compile("[\u4e00-\u9fa5]"); Matcher m = p.matcher(passwords); if (m.find()) { //包含 } else { //不包含 }
java判断字符串是否包含汉字
最新推荐文章于 2023-05-23 11:47:49 发布
Pattern p = Pattern.compile("[\u4e00-\u9fa5]"); Matcher m = p.matcher(passwords); if (m.find()) { //包含 } else { //不包含 }