开发者

How can i detect multiLanguages in string?

开发者 https://www.devze.com 2023-04-07 10:34 出处:网络
I have a string in c# How can i detect if this string contains Chars from Different Languages ? i.e : a person fills his english name in text box and also his local language name.

I have a string in c#

How can i detect if this string contains Chars from Different Languages ?

i.e : a person fills his english name in text box and also his local language name.

I want to disallow that.

something like this :

"check the language table of the chars in the string and if it comes from different unicode tables - return ERROR".

but i think there is a problem for 'a' in us or uk.

maybe im wrong.

how can i recognize more than on开发者_开发技巧e language ?


I think you're searching for codepoints. The unique identifiers of a character in codepage. I think this should be useful to you How would you get an array of Unicode code points from a .NET String?. Once you get codepoints array from the string, you can check it against the range of code points you want.

Hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消