The following code shows you sorting arrays using built in method of Array class. Array.Sort()
Imports System
Imports System.Collections
Dim array As Integer() = New Integer() {2, 1, -1, 0, 10, 4, 6, 11}
Array.Sort(arr)
For Each value As Integer In arr
Console.Write(value.ToString() & " ")
Next
Output:
-1 0 1 2 4 6 10 11
0 comments:
Post a Comment