liusheng
2023-11-13 318ff5bea1f2e41f6496da525ae7f9a3833d081d
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);
    }
}