判断是否包含中文

   public static boolean isContainChinese(String str) {

        Pattern p = Pattern.compile("[\u4e00-\u9fa5a-zA-Z]");
        Matcher m = p.matcher(str);
        if (m.find()) {
            return true;
        }
        return false;
    }

 

posted on 2016-08-09 17:25  山高似水深  阅读(258)  评论(0编辑  收藏  举报

购买方式 点击下面图标购买