Advertisement
ivandrofly

Find other char - C#

Mar 1st, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1. string word = textBox1.Text.Trim();
  2.             bool containUnicode = false;
  3.             for (int x = 0; x < word.Length; x++)
  4.             {
  5.                 if (char.GetUnicodeCategory(word[x]) == UnicodeCategory.OtherLetter)
  6.                 {
  7.                     containUnicode = true;
  8.                     break;
  9.                 }
  10.             }
  11.             if (containUnicode)
  12.             {
  13.                 MessageBox.Show("contain unicode");
  14.             }
  15.             else
  16.             {
  17.                 MessageBox.Show("does not contain unicode");
  18.             }
  19. 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