C#输入的字符串只包含汉字

时间:2023-03-09 08:42:36
C#输入的字符串只包含汉字

public  bool IsAllChineseCh(string input)
        {
            Regex regex = new Regex("^[\u4e00-\u9fa5]+$");
            return regex.IsMatch(input);
        }