|
|
System.Collections.Comparer Class |
|
|
Description | |
|
the Comparer class provides a Case-sensitive mechanism for comparing Objects. It is principally used in sort processes, where elements must be cmopared to determine their ordering.
It is the default class used by Sort and BinarySearch methods in the System.Array and System.Collections.ArrayList classes.
Because string comparisons are affected by different languages, the Comparer constructor requires a CultureInfo object that defines this cultural information.
Returns one of the following values :
ValueA < ValueB | Gives <0 |
ValueA = ValueB | Gives 0 |
ValueA > ValueB | Gives >0 |
The exact value is not guaranteed. |
|
Syntax | | | Constructor Create ( | Culture : CultureInfo; ); |
| Methods | | | | Compare | Compares one Object value with another |
|
|
| Fields | | | 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. |
|
Microsoft MSDN links | |
|
|
|
|
|
|
|
|