CSDN博客

img xuandme000

判断字符或字符串里是否有汉字

发表于2004/9/28 9:47:00  1066人阅读

判断字符或字符串里是否有汉字

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

相关文章推荐

img
取 消
img