c# - Difference between InvariantCulture and Ordinal string comparison -


When comparing two strings in C # for equality, what is the difference between invariantculture and ordinal?

invarian culture

character commands (a, b, c, ... Etc.). This is in contrast to some specific place, which can sort the characters in different commands (can be 'simultaneously'), after 'a', location, and so on).

order /

On the other hand, looks completely at the values ​​of raw byte (s) that represents the character


on it Is a great sample that shows the results of various string comparion values. Finally, in all ways, it shows (excerpted):

  String Companion. Inverian Culture: Latin small letter I (U + 09) Latin lower letter letter I (U + 0131) is less than Latin lower letter I (U + 00) Latin capital letter I (U + 0049) is less than Latin small Letter Dotals I (U + 0131) Latin Capital letter I (U + 0049) is larger than string comparison. Order: Latin little letter I (U + 09) Latin lowercase letter I (U + 0131) is less than the Latin small letter I (U + 009) Latin Capital Letter I (U + 0049) Latin small letter dots I ( U + 0131) You can see where the invention yields (U + 00 9, U + 004, U + 00131), the original yield (U + 004), the Latin Capital I (U + 00 9) greater than  

U + 0069, U + 00131).


Comments