Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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");
- }
- Found in: http://www.daniweb.com/software-development/csharp/threads/301363/c-function-to-check-if-a-string-contain-chinese-charater
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement