mscorlib 2.0.0.0 4.0.0.0 System.Enum System.Runtime.InteropServices.ComVisible(true)

The enumeration is used to specify whether a string comparison should use the current culture or the invariant culture, word or ordinal sort rules, and be case-sensitive or case-insensitive.

When you call a string comparison method such as , , or , you should always call an overload that includes a parameter of type so that you can specify the type of comparison that the method performs. For more information, see Best Practices for Using Strings in the .NET Framework.

An operation that uses word sort rules performs a culture-sensitive comparison wherein certain nonalphanumeric Unicode characters might have special weights assigned to them. Using word sort rules and the conventions of a specific culture, the hyphen ("-") might have a very small weight assigned to it so that "coop" and "co-op" appear next to each other in a sorted list.

An operation that uses ordinal sort rules performs a comparison based on the numeric value (Unicode code point) of each in the string. An ordinal comparison is fast but culture-insensitive. When you use ordinal sort rules to sort strings that start with Unicode characters (U+), the string U+xxxx comes before the string U+yyyy if the value of xxxx is numerically less than yyyy.

For more information about comparisons, see the class remarks. For more information about culture, see the class remarks. For guidelines on when to use ordinal or culture-sensitive comparison rules or the rules of the invariant culture, see Best Practices for Using Strings in the .NET Framework.

Specifies the culture, case, and sort rules to be used by certain overloads of the and methods.

- Field
  2.0.0.0
  4.0.0.0
  System.StringComparison

  Compare strings using culture-sensitive sort rules and the current culture.

- Field
  2.0.0.0
  4.0.0.0
  System.StringComparison

  Compare strings using culture-sensitive sort rules, the current culture, and ignoring the case of the strings being compared.

- Field
  2.0.0.0
  4.0.0.0
  System.StringComparison

  Compare strings using culture-sensitive sort rules and the invariant culture.

- Field
  2.0.0.0
  4.0.0.0
  System.StringComparison

  Compare strings using culture-sensitive sort rules, the invariant culture, and ignoring the case of the strings being compared.

- Field
  2.0.0.0
  4.0.0.0
  System.StringComparison

  Compare strings using ordinal sort rules.

- Field
  2.0.0.0
  4.0.0.0
  System.StringComparison

  Compare strings using ordinal sort rules and ignoring the case of the strings being compared.