Comparer Class
Compares two objects for equivalence, where string comparisons are case-sensitive.
Assembly: mscorlib (in mscorlib.dll)
| Name | Description | |
|---|---|---|
![]() | Comparer(CultureInfo) | Initializes a new instance of the Comparer class using the specified System.Globalization.CultureInfo. |
| Name | Description | |
|---|---|---|
![]() | Compare(Object, Object) | Performs a case-sensitive comparison of two objects of the same type and returns a value indicating whether one is less than, equal to, or greater than the other. |
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetObjectData(SerializationInfo, StreamingContext) | Populates a SerializationInfo object with the data required for serialization. |
![]() | GetType() | |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | Default | Represents an instance of Comparer that is associated with the Thread.CurrentCulture of the current thread. This field is read-only. |
![]() ![]() | DefaultInvariant | Represents an instance of Comparer that is associated with CultureInfo.InvariantCulture. This field is read-only. |
This class is the default implementation of the IComparer interface. The CaseInsensitiveComparer class is the implementation of the IComparer interface that performs case-insensitive string comparisons.
Comparison procedures use the Thread.CurrentCulture of the current thread unless otherwise specified. String comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the System.Globalization namespace and Globalizing and Localizing .NET Framework Applications.
Available since 10
.NET Framework
Available since 1.1
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


