Sorts the elements in a section of ArrayList using the specified comparer.
[Visual Basic] Overloads Overridable Public Sub Sort( _ ByVal index As Integer, _ ByVal count As Integer, _ ByVal comparer As IComparer _ ) [C#] public virtual void Sort( int index, int count, IComparer comparer ); [C++] public: virtual void Sort( int index, int count, IComparer* comparer ); [JScript] public function Sort( index : int, count : int, comparer : IComparer );
-or-
a null reference (in Visual Basic Nothing) to use the IComparable implementation of each element.
None.
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | index is less than zero.
-or- count is less than zero. |
ArgumentException | index and count do not specify a valid range in the ArrayList. |
NotSupportedException | The ArrayList is read-only. |
This method can be overridden by a derived class.
ArrayList Class | ArrayList Members | System.Collections Namespace | ArrayList.Sort Overload List