RosettaCodeData/Task/Tokenize-a-string-with-escaping/Zkl/tokenize-a-string-with-escaping-2.zkl
2023-07-01 13:44:08 -04:00

5 lines
180 B
Text

fcn tokenize(str,sep,esc){
sink:=Sink(String);
foreach c in (str){ sink.write( (c==esc and __cWalker.next()) or (c==sep and "\xff") or c ) }
sink.close().split("\xff");
}