Hi guys,

is there any build-in function in C# that can detect if a string contain Chinese/Japanese character? This string may contain alphabet, numeric, chinese and japanese characters. Appreciate any advice please. Thanks in advance!

Cheers,
Mark

Hi guys,

Sorry i am really i dumbass. below are the solution:

string word = textBox1.Text.Trim();
            bool containUnicode = false;
            for (int x = 0; x < word.Length; x++)
            {
                if (char.GetUnicodeCategory(word[x]) == UnicodeCategory.OtherLetter)
                {
                    containUnicode = true;
                    break;
                }
            }
            if (containUnicode)
            {
                MessageBox.Show("contain unicode");
            }
            else
            {
                MessageBox.Show("does not contain unicode");
            }

Enjoy!

Cheers,
Mark Thien

This question has already been answered. Start a new discussion instead.