0

I am working on C#

I have some values in an array .

Stirng [] values;

Some of the values inside array are in chinese value .

I have to put these values in Database. Before putting this in Database i want to find out which values are in Chinese.

So that i can create proper SQLString to Execute

check isChinese(String abc ){
    **Condition for chinese unicode** ???

    return true or false
}

____
if tovalue isChinese == true 
     SqlValue= N +" ' toValue ' "

else
    SqlValue= SqlValue

SqlQuery = SqlQuery + SqlValue
GameBuilder
  • 1,169
  • 4
  • 31
  • 62

2 Answers2

1

A related question on how to do a character range check: Is there a way to check whether unicode text is in a certain language?

The full range of the Chinese character set can be found here: What's the complete range for Chinese characters in Unicode?

Hope this helps!

Community
  • 1
  • 1
DasMehdi
  • 28
  • 2
  • hey this is first time i am using C#, Can you explain me how to use all these.EVEN for your first LINK `return text.IndexOfAny(c => c >= 0x20000 && c <= 0xFA2D);` there is a error Lambda expression to type Char[] because it is not a delegate type – GameBuilder Sep 23 '13 at 15:35
0

You have to save all the Chinese characters in an array (char[] or string[]).

Then call the function, and have it check if the parameter is in the array:

if (chineseletters.IndexOf(parameter) >= 0) {
  return "This is a Chinese character!";
} else return "This is not a Chinese character!";
Johnaudi
  • 257
  • 1
  • 23