How to reverse a string in VB/A
There are many ways to do a simple string inversion, character by character, with VB/A. This function uses the Mid$ keyword as a function and as a statement to do it.
'Reverses a string, eg "1234567890" becomes "0987654321"
'Particularity: uses Mid$() as a getter and as a setter.
Public Function ReverseString(ByVal psString As String) As String
Dim sReverse As String
Dim iLen As Integer
Dim i As Integer
iLen = Len(psString)
If iLen = 0 Then Exit Function
sReverse = Space$(iLen)
For i = 1 To iLen
Mid$(sReverse, iLen - i + 1, 1) = Mid$(psString, i, 1)
ReverseString = sReverse