Array.Sort<T> Method (T[], Int32, Int32) |
Sorts the elements in a range of elements in an
Array using the
IComparable< T> generic interface implementation of each element of the
Array.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public static void Sort<T>(
T[] array,
int index,
int length
)
Parameters
- array
- Type:T[]
The one-dimensional, zero-based Array to sort - index
- Type: System.Int32
The starting index of the range to sort. - length
- Type: System.Int32
The number of elements in the range to sort.
Type Parameters
- T
- The type of the elements of the array.
Exceptions Exception | Condition |
---|
ArgumentNullException | array is null. |
ArgumentOutOfRangeException | index is less than the lower bound of array.-or-length is less than zero. |
ArgumentException | index and length do not specify a valid range in array. |
InvalidOperationException | One or more elements in array do not implement the IComparable< T> generic interface. |
See Also