Home All Groups Group Topic Archive Search About
Author
9 Mar 2006 10:05 PM
lyudmilal
I have a list of last names that can be in different languages:
chinese, english, russian, german, etc.  Different format need to be
applied only for last names in chinese.  For this purpose, I need to
check if last name contains chinese characters.  Any ideas how to do it
(it should be data related check)?

Thank you,
Ludmila

Author
9 Mar 2006 10:37 PM
Jon Skeet [C# MVP]
<lyudmi***@ungerboeck.com> wrote:
> I have a list of last names that can be in different languages:
> chinese, english, russian, german, etc.  Different format need to be
> applied only for last names in chinese.  For this purpose, I need to
> check if last name contains chinese characters.  Any ideas how to do it
> (it should be data related check)?

Identify the range of Chinese characters (using the code charts at
http://www.unicode.org) and look through each character in the last
name (eg using String.Split or a regex to get the last name) and see
whether or not it's Chinese.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Bookmark and Share