close
如標題
/// <summary> /// 判斷字串中是否含有中文 /// </summary> /// <param name="strChinese"></param> /// <returns></returns> private bool isChinese(string strChinese) { bool bresult = true; int dRange = 0; int dstringmax = Convert.ToInt32("9fff", 16); int dstringmin = Convert.ToInt32("4e00", 16); for (int i = 0; i < strChinese.Length; i++) { dRange = Convert.ToInt32(Convert.ToChar(strChinese.Substring(i, 1))); if (dRange >= dstringmin && dRange < dstringmax) { bresult = true; break; } else { bresult = false; } } return bresult; }
全站熱搜
留言列表