判断是否是中文

来源:互联网 发布:武汉人工智能创业公司 编辑:程序博客网 时间:2024/05/17 23:56
public bool IsChina(string CString)
{
   bool BoolValue=false;
   for (int i=0; i<CString.Length; i++)
   {
      if(Convert.ToInt32(Convert.ToChar(CString.Substring(i,1)))<Convert.ToInt32(Convert.ToChar(128)))
          BoolValue = false;
      }
      else
      {
          BoolValue = true;
      }
    }
    return BoolValue;
}
0 0
原创粉丝点击