Bug in the string comparing of the .NET Framework
问题 It's a requirement for any comparison sort to work that the underlying order operator is transitive and antisymmetric. In .NET, that's not true for some strings: static void CompareBug() { string x = "\u002D\u30A2"; // or just "-ア" if charset allows string y = "\u3042"; // or just "あ" if charset allows Console.WriteLine(x.CompareTo(y)); // positive one Console.WriteLine(y.CompareTo(x)); // positive one Console.WriteLine(StringComparer.InvariantCulture.Compare(x, y)); // positive one Console