判断字符串是否包含中文

xiaoxiao2021-02-28  132

public static boolean isContainChinese(String str) {        Pattern p = Pattern.compile("[\u4e00-\u9fa5]");        Matcher m = p.matcher(str);        if (m.find()) {            return true;        }        return false;    }
转载请注明原文地址: https://www.6miu.com/read-40337.html

最新回复(0)