Click or drag to resize
ArrayListSort Method (Int32, Int32, IComparer)
Sorts the elements in a range of elements in ArrayList using the specified comparer.

Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public virtual void Sort(
	int index,
	int count,
	IComparer comparer
)

Parameters

index
Type: SystemInt32
The zero-based starting index of the range to sort.
count
Type: SystemInt32
The length of the range to sort.
comparer
Type: System.CollectionsIComparer
The IComparer implementation to use when comparing elements.-or- A null reference (Nothing in Visual Basic) to use the IComparable implementation of each element.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionindex is less than zero.-or- count is less than zero.
ArgumentExceptionindex and count do not specify a valid range in the ArrayList.
NotSupportedExceptionThe ArrayList is read-only.
InvalidOperationExceptionAn error occurred while comparing two elements.
See Also