I found a great piece of code to check if the given string contains chinese characters .
private bool IsLetterChinese(string strText)
{
int start = Convert.ToInt32("4E00",16);
int end = Convert.ToInt32("9FBF",16);
for(int i=0;i
if ((Char.ConvertToUtf32(text, i) >= start) && (Char.ConvertToUtf32(text, i) <= end))
return true;
return false;
}
Thanks Marc, for providing this awesome piece of code.
No comments:
Post a Comment