comp • gb • string[] • sort

String[].Sort (gb)

Function Sort ( [ Mode As Integer ] ) As String[]

Sort the array and return it.

The Mode argument is a combination of the comparison flags defined in Comparison methods and one of the following direction flag:

gb.Ascent Specify an ascending sort. This is the default.
gb.Descent Specify a descending sort.

Examples

Dim S As String
Dim SSS As String[] = ["abcdefghij", "1234567890", "ABCDEFGHIJ"]
'
For Each S In SSS.sort(gb.Ascent)
  Print S
Next

' The empty set of parentheses is REQUIRED when sort is called
' without the optional mode parameter and is expected to return 
' an array.
For Each S In SSS.sort()
  Print S
Next

' The empty set of parentheses is NOT required to sort the array
' without returning anything.
SSS.sort
For Each S In SSS
  Print S
Next
' all three examples print the following:
1234567890
ABCDEFGHIJ
abcdefghij

See also