Reverse words in a string: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 1,939: | Line 1,939: | ||
Frost Robert ----------------------- |
Frost Robert ----------------------- |
||
") |
") |
||
aList = str2list(cStr) |
|||
for x in aList |
|||
x2 = substr(x," ",nl) alist2 = str2list(x2) aList2 = reverse(aList2) |
|||
for y in aList2 see y + " " next see nl |
|||
next |
|||
</lang> |
|||
Output |
|||
<lang ring> |
|||
------------ Fire and Ice ---------- |
|||
Some say the world will end in fire, |
|||
Some say in ice. |
|||
From what I've tasted of desire |
|||
I hold with those who favor fire. |
|||
... last paragraph elided ... |
|||
----------------------- Robert Frost |
|||
</lang> |
</lang> |
||