/// <summary> /// 判断字符串全部是否是中文。返回true 则表示含有非中文 /// </summary> /// <param name="str_chinese"></param> /// <returns></returns> public bool IsChinese(string str_chinese) { bool b = false; for (int i = 0; i < str_chinese.Length; i++) { Regex reg = new Regex(@"[\u4e00-\u9fa5]"); if (!reg.IsMatch(str_chinese[i].ToString())) { b = true; break; } } return b; }
时间: 2024-10-10 15:36:10