RosettaCodeData/Task/Reverse-a-string/GFA-Basic/reverse-a-string.basic

11 lines
186 B
Plaintext

PRINT @reverse$("asdf")
'
FUNCTION reverse$(string$)
LOCAL result$,i%
result$=""
FOR i%=1 TO LEN(string$)
result$=MID$(string$,i%,1)+result$
NEXT i%
RETURN result$
ENDFUNC