Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is char in unicode class?

In .Net, given a char, is there a way to tell if that character is part of a specific Unicode category? The categories I'm interested are defined here http://www.fileformat.info/info/unicode/category/index.htm

For example, is there a function that does anything like this?:

bool isCharInClass(Char c, String class)

that could be called like:

SomeClass.isCharInClass("a", "Lo");
like image 567
Bradley Uffner Avatar asked Feb 01 '26 05:02

Bradley Uffner


1 Answers

You can use Char.GetUnicodeCategory or CharUnicodeInfo.GetUnicodeCategory to get the unicode category (as a UnicodeCategory).

like image 130
Reed Copsey Avatar answered Feb 03 '26 19:02

Reed Copsey