Click or drag to resize
ArraySort Method (Array, Int32, Int32)
Sorts the elements in a range of elements in a one-dimensional Array using the IComparable implementation of each element of the Array.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static void Sort(
	Array array,
	int index,
	int length
)

Parameters

array
Type: SystemArray
The one-dimensional Array to sort.
index
Type: SystemInt32
The starting index of the range to sort.
length
Type: SystemInt32
The number of elements in the range to sort.
Exceptions
ExceptionCondition
ArgumentNullExceptionarray is null.
RankExceptionarray is multidimensional.
ArgumentOutOfRangeExceptionindex is less than the lower bound of array.-or-length is less than zero.
ArgumentExceptionindex and length do not specify a valid range in array.
InvalidOperationExceptionOne or more elements in array do not implement the IComparable interface.
See Also