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

7 lines
239 B
Plaintext

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