如何在C#中找到Unicode字符的双向字符类型? [英] How do I find a Unicode character's bidirectional character type in C#?

查看:84
本文介绍了如何在C#中找到Unicode字符的双向字符类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法可以在C#中找到Unicode字符的双向字符类型吗?

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

我想浏览一下字符串中的字符,并确定它们是否都是强LTR,强RTL,强LTR和中性的混合,等等.

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.

推荐答案

System.Globalization.CharUnicodeInfo.GetBidiCategory(ch)是你的朋友.

问题在于该函数是内部函数. 这篇MichKap(RIP)博客文章向您展示了如何使用反思.

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

这篇关于如何在C#中找到Unicode字符的双向字符类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆