RosettaCodeData/Task/Tokenize-a-string/Logo/tokenize-a-string-2.logo

7 lines
239 B
Text
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
to split :str :by [:acc []] [:w "||]
if empty? :str [output lput :w :acc]
ifelse equal? first :str :by ~
[output (split butfirst :str :by lput :w :acc)] ~
[output (split butfirst :str :by :acc lput first :str :w)]
end