Sorts the elements in a one-dimensional Array, using the specified IComparer interface.
[Visual Basic] Overloads Public Shared Sub Sort( _ ByVal array As Array, _ ByVal comparer As IComparer _ ) [C#] public static void Sort( Array array, IComparer comparer ); [C++] public: static void Sort( Array* array, IComparer* comparer ); [JScript] public static function Sort( array : Array, comparer : IComparer );
-or-
a null reference (in Visual Basic Nothing) to use the IComparable implementation of each element.
None.
Exception Type | Condition |
---|---|
ArgumentNullException | array is a null reference (Nothing). |
RankException | array is multidimensional. |
InvalidCastException | comparer is a null reference (Nothing), and one or more elements in array does not implement the IComparable interface. |
If comparer is a null reference (Nothing), each element of array must implement the IComparable interface to be capable of comparisons with every other element in array.
Array Class | Array Members | System Namespace | Array.Sort Overload List | IComparer | IComparable | BinarySearch