0

我试图在使用StringComparer.OrdinalignoreCaseand时获取字符串比较结果之间的关系StringComparer.InvariantCultureIgnoreCase。更准确地说,我想知道以下四种说法中哪一种是正确的:

  1. a == b using StringComparer.OrdinalIgnoreCase, 然后a == b using StringComparer.InvariantCultureIgnoreCase
  2. a != b using StringComparer.OrdinalIgnoreCase, 然后a != b using StringComparer.InvariantCultureIgnoreCase
  3. a == b using StringComparer.InvariantCultureIgnoreCase, 然后a == b using StringComparer.OrdinalIgnoreCase
  4. a != b using StringComparer.InvariantCultureIgnoreCase, 然后a != b using StringComparer.OrdinalIgnoreCase

到目前为止,我知道第 3 条陈述是不正确的,因为这个问题中的评论的例子a = STRASSE和评论。b = Straße

理想情况下,我想解释为什么一个陈述是正确的,或者一个不正确的例子。

4

1 回答 1

0

The difference between Ordinal and Invariant collation is the difference between non-linguistic and linguistic collation.

In theory 1 should be true (it is if you do not ignore case) but the casing rules are different when you use non-linguistic casing and linguistic casing. The rest are false.

于 2014-10-21T22:43:20.237 回答