Wednesday, January 14, 2009

check string contains chinese character or not in C#

string word = "是集室內";


char fo = word[0];

UnicodeCategory cat = char.GetUnicodeCategory(fo);
if (cat == UnicodeCategory.OtherLetter)
{
//chinese char
}
else
{
//english char
}