c# - 用于字符串比较的可忽略字符列表

标签 c# string unicode

C# 中的文化敏感比较不考虑“可忽略的字符”:

Character sets include ignorable characters. The Compare(String, String) method does not consider such characters when it performs a culture-sensitive comparison. For example, a culture-sensitive comparison of "animal" with "ani-mal" (using a soft hyphen, or U+00AD) indicates that the two strings are equivalent, as the following example shows.

我在哪里可以找到此类字符的完整列表以及比较包含可忽略字符的字符串的一些详细信息?

最佳答案

所有 Unicode 代码点都有一个由 Unicode 联盟指定的“默认可忽略”属性;如果可忽略字符的 .NET 概念与该属性的值有任何不同,我会感到非常惊讶。

默认可忽略字符的权威资源是 Unicode 标准,特别是第 5.21 节(link to chapter 5 PDF for Unicode v6.2.0)。

关于c# - 用于字符串比较的可忽略字符列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21454345/

相关文章:

c# - 编码风格和属性的性能

c# - 从 HTML 创建 Word 文档

c# - 已进行选择时卡住列表框项目的选择

c - C中的字符串输入和输出

c - strtoull 基于输入字符串

python - python re (regex) 是否有 unicode 转义序列的替代方案?

Python ASCII 到 Unicode

c# - 如何替换 ASP.NET Core View 类的 "Request"类方法?

c++ - std::string 的指针数组

java - 有人可以帮我解决这个问题吗?关于统一码