C#判断字符串儿是否为汉字(中文)
public bool IsChinese(string CString){ // Console.WriteLine("{0}", CString.Length); bool BoolValue = false; for (int i= 0; i < CString.Length; i++) { if (Convert.ToInt32(Convert.ToChar(CString.Substring(i, 1))) < 128) { BoolValue = false; } else { BoolValue = true; } } return BoolValue;}
页:
[1]