Possible duplicate:Return the language of the given string
The task is to sort the list of strings. Priority in a specific language. Strings can be written in different languages. For example, Chinese, English, Russian. And I need to take all the Chinese first, and then the rest.
To do this, I want to know which country (language) belongs to a certain character in the string. (For example, on the first letter)
Are there any classes or methods?
If we are talking about alphabets, you can simply check the int representation of char by doing it:
int unicodeValue = (int)myString[0];
, , , , ., 丐 19984, 4E10 (19984.ToString("X")), CJK. , , .
丐
19984
4E10
19984.ToString("X")
, , , Soundex.
?
()
var text = "¿Dónde está el baño?"; google.language.detect(text, function(result) { if (!result.error) { var language = 'unknown'; for (l in google.language.Languages) { if (google.language.Languages[l] == result.language) { language = l; break; } } var container = document.getElementById("detection"); container.innerHTML = text + " is: " + language + ""; } });