Ordinal in String.Equals in C# #144
-
Hi, I didn't understand how Ordinal exactly works. Could you please explain? How does Ordinal work in the background? Microsft said:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Sorting strings depends on the culture. The table in the following link gives the order for the value cote, coté, côte, côté, Namibia... with English-US, French-France, and Spanish-Spain: Using different cultures, the sort order not only depends on special characters as shown in the previous table, but there are also differences how some ASCII characters are sorted. One language I came across had the same sort order for two different characters, thus here the next character was important how a string was sorted. With ordinal sort rules, also binary was mentioned. This gives a hint. Here the sort is done based on the binary number value. For whom are you sorting strings?
|
Beta Was this translation helpful? Give feedback.
Sorting strings depends on the culture. The table in the following link gives the order for the value cote, coté, côte, côté, Namibia... with English-US, French-France, and Spanish-Spain:
Sort order sample table
Using different cultures, the sort order not only depends on special characters as shown in the previous table, but there are also differences how some ASCII characters are sorted. One language I came across had the same sort order for two different characters, thus here the next character was important how a string was sorted.
With ordinal sort rules, also binary was mentioned. This gives a hint. Here the sort is done based on the binary number value.
For whom are you sorting str…