How do I find a Unicode character's bidirectional character type in C#?

梦想与她 提交于 2019-12-10 12:57:23

问题


Is there any way I can find a Unicode character's bidirectional character type in C#?

I want to look through the characters in a string and decide if they are all strong LTR, strong RTL, a mixture of strong LTR and neutral, etc.


回答1:


System.Globalization.CharUnicodeInfo.GetBidiCategory(ch) is your friend.

The problem is that the function is internal. This MichKap (RIP) blog post shows you how to call it using reflection.



来源:https://stackoverflow.com/questions/7255200/how-do-i-find-a-unicode-characters-bidirectional-character-type-in-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!