Java检测字符串中是否包含汉字

    public static boolean checkChinese(String sequence) {
            final String format = "[\\u4E00-\\u9FA5\\uF900-\\uFA2D]";
            boolean result = false;
            Pattern pattern = Pattern.compile(format);
            Matcher matcher = pattern.matcher(sequence);
            result = matcher.find();
            return result;
        }

编程技巧