Reverse a string quickly and efficiently.
Reverse a string quickly and efficiently.
Rate Reverse a string quickly and efficiently.
(1(1 Vote))
Dim idx As Long
Dim ByteArray() As Byte
Dim tmpByte As Byte
Dim MAX As Long
ByteArray = StrConv(YourString, vbFromUnicode)
MAX = Len(YourString) - 1
For idx = 0 To MAX \ 2
tmpByte = ByteArray(idx)
ByteArray(idx) = ByteArray(MAX - idx)
ByteArray(MAX - idx) = tmpByte
Next idx
ReverseString = StrConv(ByteArray, vbUnicode)
End Function
Reverse a string quickly and efficiently. Comments
No comments yet — be the first to post one!
Post a Comment