下面的函数利用递归原理获得字符串的翻转字符串

Function reversestring(revstr As String) As String

revstr: 要翻转的字符串

返回值:翻转后的字符串

 

Dim doreverse As Long

 

reversestring = ""

For doreverse = Len(revstr) To 1 Step -1

reversestring = reversestring & Mid$(revstr, doreverse, 1)

Next

 

End Function