ArraySortT Method (T, ComparisonT) |
Sorts the elements in an
Array using the specified
ComparisonT.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public static void Sort<T>(
T[] array,
Comparison<T> comparison
)
Parameters
- array
- Type: T
The one-dimensional, zero-based Array to sort - comparison
- Type: SystemComparisonT
The ComparisonT to use when comparing elements.
Type Parameters
- T
- The type of the elements of the array.
Exceptions Exception | Condition |
---|
ArgumentNullException | array is null.-or-comparison is null. |
ArgumentException | The implementation of comparison caused an error during the sort. For example, comparison might not return 0 when comparing an item with itself. |
See Also