Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reverse and insert into string

Status
Not open for further replies.

yissam

Technical User
Mar 16, 2011
2
GB
Hi

I am very new to VBscript. Could any one let me know please how to read a number, reverse it and insert a full stop '.' between all digits (input 1234567890 output 0.9.8.7.6.5.4.3.2.1)

Thanks
 
VBScript reference

Actually, there is reverse string function in vbs.

Code:
strInput = "1234567890"
strRev = [red]StrReverse(strInput)[/red]

strOutput = ""
for i = 1 to len(strRev)
   strOutput = strOutput & mid(strRev, i, 1) & "."
next

'take off the last stop
strOutput = left(strOutput, len(strOutput) - 1)

-Geates


"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
- Martin Golding

"There are seldom good technological solutions to behavioral problems."
- Ed Crowley, Exchange guru and technology curmudgeon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top