reverse string ?

Godlike29
09-08-2003, 03:29 AM
How would I reverse a string like A1B2C3D4A6 and change to A6D4C3B2A1.

I can reverse the string to 6A4D3C2B1A using ReverseIt() function no problems.

Is there a different approach needed ?

regards

candela
09-08-2003, 03:35 AM
do u want to reverse two char a time?
new_string=""
while LEN(old_string)>0
new_string=new_string & right(old_string,2)
old_string = left(old_string,len(old_string)-2)
wend is this what u means?

Godlike29
09-08-2003, 03:57 AM
do u want to reverse two char a time?
new_string=""
while LEN(old_string)>0
new_string=new_string & right(old_string,2)
old_string = left(old_string,len(old_string)-2)
wend is this what u means?


Yes that works fine :)

Thx

OnErr0r
09-08-2003, 08:21 AM
StrReverse() :p

oops, didn't notice you were doing two chars at a time

Time to make some tea and wake up. :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum