I would expect that “2-” and “22” would always compare the same, but changing the third character changes the sort order.
string.Compare("2-1","22-", StringComparison.CurrentCulture)
string.Compare("2-2","22-", StringComparison.CurrentCulture)
What is going on here?
Our culture, by the way, is in the USA.
source
share