判断字符串中是否包含中文

xiaoxiao2021-02-28  80

/// <summary> /// 判断字符串中是否包含中文 /// </summary> /// <param name="str">需要判断的字符串</param> /// <returns>判断结果</returns> public static bool HasChinese( this string str) {    return Regex.IsMatch(str, @"[\u4e00-\u9fa5]" ); }
转载请注明原文地址: https://www.6miu.com/read-46972.html

最新回复(0)