Click or drag to resize
ArraySortT Method (T, ComparisonT)
Sorts the elements in an Array using the specified ComparisonT.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
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
ExceptionCondition
ArgumentNullExceptionarray is null.-or-comparison is null.
ArgumentExceptionThe implementation of comparison caused an error during the sort. For example, comparison might not return 0 when comparing an item with itself.
See Also