Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,25 @@
|
|||
-- MAXScript : Reverse words in a string : N.H. 2019
|
||||
--
|
||||
(
|
||||
text = stringstream "---------- Ice and Fire ------------\n\nfire, in end will world the say Some\nice. in say Some\ndesire of tasted I've what From\nfire. favor who those with hold I\n\n... elided paragraph last ...\n\nFrost Robert -----------------------\n"
|
||||
clearListener()
|
||||
seek text 0
|
||||
while eof text == false do
|
||||
(
|
||||
nextLine = (readLine text)
|
||||
if nextLine == "" then
|
||||
(
|
||||
print ""
|
||||
continue
|
||||
) -- end of if
|
||||
revLine = ""
|
||||
eachWord = filterString nextLine " "
|
||||
for k = eachWord.count to 1 by -1 do
|
||||
(
|
||||
revLine = revLine + eachWord[k]
|
||||
-- Only add space between words not at the end of line
|
||||
if k != 1 then revLine = revLine + " "
|
||||
) -- end of for k
|
||||
print revLine
|
||||
) -- end of while eof
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue