RosettaCodeData/Task/Reverse-a-string/REXX/reverse-a-string-2.rexx

11 lines
455 B
Rexx
Raw Permalink Normal View History

2013-04-10 23:57:08 -07:00
/*REXX program to reverse a string (and show before and after strings).*/
string1 = 'A man, a plan, a canal, Panama!'
string2 =
do j=1 for length(string1)
string2 = substr(string1,j,1)string2
end /*j*/
say ' original string: ' string1
say ' reversed string: ' string2
/*stick a fork in it, we're done.*/