2006 Nov 30 3:26 AM
Hai....
Can any one say me what is the string operation that i have to use to reverse the contents of a string...say the string is 'ABCDE'...i want it as 'EDCBA'.
Will be rewarded if helpfull.....
Regards,
Jhansi..
2006 Nov 30 4:08 AM
Hai Janu
Run this Program.
data : c(5) value 'ABCDE'.
data : l type i,i type i value -1.
data : str(5) .
l = strlen( c ).
do l times.
i = i + 1.
l = l - 1.
STRi(1) = Cl(1).
enddo.
write STR.
2006 Nov 30 3:28 AM
Sorry, My fault
After all there is a function - STRING_REVERSE
Regards,
Ravi
Message was edited by:
Ravikumar Allampallam
2006 Nov 30 3:29 AM
2006 Nov 30 3:34 AM
2006 Nov 30 3:38 AM
Hi Jhansi kiran,
Use FM "STRING_REVERSE" . By using the "SHIFT" also you can achieve,but lengthy way.
Pls. reward for useful answers
2006 Nov 30 3:48 AM
try this code
data : strlength type i,
main(5) type c value 'abcde',
rev(5),
counter type i,
temp type i.
compute strlength = strlen( main ).
temp = strlength.
do strlength times.
temp = temp - 1.
revcounter(1) = maintemp(1).
counter = counter + 1.
enddo.
regards
shiba dutta
2006 Nov 30 4:08 AM
Hai Janu
Run this Program.
data : c(5) value 'ABCDE'.
data : l type i,i type i value -1.
data : str(5) .
l = strlen( c ).
do l times.
i = i + 1.
l = l - 1.
STRi(1) = Cl(1).
enddo.
write STR.