Pages

Thursday, November 26, 2009

Check string contains chinese character or not in C#

string word = “销售额 ;
char c = word[0];
UnicodeCategory cat = char.GetUnicodeCategory(c);
if (cat == UnicodeCategory.OtherLetter)
{
//chinese char
}
else
{
//english char
}

0 comments: