RosettaCodeData/Task/Reverse-words-in-a-string/Liberty-BASIC/reverse-words-in-a-string.basic

27 lines
568 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
for i = 1 to 10
read string$
print reverse$(string$)
next
end
function reverse$(string$)
token$="*"
while token$<>""
i=i+1
token$ = word$(string$, i)
output$=token$+" "+output$
wend
reverse$ = trim$(output$)
end function
data "---------- Ice and Fire ------------"
data ""
data "fire, in end will world the say Some"
data "ice. in say Some"
data "desire of tasted I've what From"
data "fire. favor who those with hold I"
data ""
data "... elided paragraph last ..."
data ""
data "Frost Robert -----------------------"