Question

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
Was it helpful?

Solution

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!

OTHER TIPS

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!";
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top