[sourcecode language=”vb”]Private Function ascSort(statement) As String
Dim a() As String
Dim temp As String
Dim num As Integer
a() = Split(statement, "|")
num = UBound(a) – LBound(a)
For i = 0 To num – 1
For j = i + 1 To num – 1
If CSng(a(i)) > CSng(a(j)) Then
temp = a(i)
a(i) = a(j)
a(j) = temp
End If
Next j
Next i
End Function
Private Sub Form_Load()
Dim a,b As String
a = "5|6|8|9|1"
b = ascSort(a)
Print b
End Sub