JakeB52
asked on
reverse a string
Is there any way to reverse a string similar to this "2000 2001 2004 " so it looks like "2004 2001 2000".
I have tried StrReverse (strYears) without any success.
Some important things to note:
1) The number of years may vary in a string
2) There will always be an undetermined number of spaces at the end of the string
3) I'm using Access 2000
Any help would be appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Use this new function StrReverse().
dim iCounter%
dim sDone$
sList = Split(sInput, " ")
for iCounter = ubound(sList) to lbound(sList) step -1
sDone = sDone & " " & sList(iCounter)
next
sDone = Trim(sDone)
Done :)