Coming from this question I'm wondering why ?
and ae
are different(which makes sense) but ?
and ss
are treated as equal. I haven't found an answer on SO even if this question seems to be related and even mentions "that ?
will compare equal to SS
in Germany, or similar" but not why.
The only resource on MSDN I found was this: How to: Compare Strings
Here is mentioned following but also lacks the why:
// "They dance in the street."
// Linguistically (in Windows), "ss" is equal to
// the German essetz: '?' character in both en-US and de-DE cultures.
.....
So why does this evaluate to true
, both with de-DE
culture or any other culture:
var ci = new CultureInfo("de-DE");
int result = ci.CompareInfo.Compare("strasse", "stra?e", CompareOptions.IgnoreNonSpace); // 0
bool equals = String.Equals("strasse", "stra?e", StringComparison.CurrentCulture); // true
equals = String.Equals("strasse", "stra?e", StringComparison.InvariantCulture); // true
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…