To sort array elements in ascending order or reverse order a simple way is to sort the array in ascending order, then reverse it. in the Blog First sort the array using Array. Sort and then use Array.Reverse.
Dim sortarray As Integer() = New Integer() {1, 2, 6, 4, 7, 3, 5}
Array.Sort(sortarray)
' sort in ascending order
For Each k As Integer In sortarray
lblMessage.Text += k & " <br />"
Next
' reverse in descending order
Array.Reverse(sortarray)
For Each k As Integer In sortarray
lblMessage.Text += k & " <br />"
Next
End Sub

Join the conversation! Your thoughts help the community grow.