-
Notifications
You must be signed in to change notification settings - Fork 36
M_CodeJam_Collections_ArrayExtensions_Sort__1_2
Andrew Koryavchenko edited this page Jun 17, 2018
·
7 revisions
Sorts the elements in an Array using the specified Comparison(T).
Namespace: CodeJam.Collections
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0
C#
public static void Sort<T>(
this T[] array,
Comparison<T> comparison
)
VB
<ExtensionAttribute>
Public Shared Sub Sort(Of T) (
array As T(),
comparison As Comparison(Of T)
)
F#
[<ExtensionAttribute>]
static member Sort :
array : 'T[] *
comparison : Comparison<'T> -> unit
- array
- Type: T[]
The one-dimensional, zero-based Array to sort - comparison
- Type: System.Comparison(T)
The Comparison(T) to use when comparing elements.
- T
- The type of the elements of the array.
In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exception | Condition |
---|---|
ArgumentNullException | array is null.-or-comparison is null. |
ArgumentException | The implementation of comparison caused an error during the sort. For example, comparison might not return 0 when comparing an item with itself. |
ArrayExtensions Class
Sort Overload
CodeJam.Collections Namespace