liusheng
2023-11-10 6f344e6360751574f7e03b21c00cfa3f4b2bc099
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package com.ruoyi.common.utils;
 
public class ChineseUtils {
 
    /**
     * 校验是否是中文
     *
     * @param str
     * @return
     */
    public static boolean isChinese(String str) {
        String regex = "[\\u4e00-\\u9fa5]+";
        return str.matches(regex);
    }
}