Private Function ReverseString(ByVal strText As String) As String
' Define Variables
Dim strReturn As String = String.Empty
Dim strNumbers As String = String.Empty
' Loop through the text, starting at the last character and working backwards
For i As Int32 = strText.Length - 1 To 0 Step -1
' If the character is a number, add it to a number string
If IsNumeric(strText.Substring(i, 1)) Then
strNumbers = strText.Substring(i, 1).ToString & strNumbers
Else
' If the chararcter is not a number, check to see if the number string is empty
' If not, add it plus the character and clear the number string holder
' Otherwise, just add the character
If strNumbers <> String.Empty Then
strReturn &= strNumbers
strNumbers = String.Empty
End If
strReturn &= strText.Substring(i, 1)
End If
Next
' Put the reversed string somewhere
Return strReturn
End Function