Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
18
Task/Tokenize-a-string/SETL/tokenize-a-string.setl
Normal file
18
Task/Tokenize-a-string/SETL/tokenize-a-string.setl
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
program tokenize_a_string;
|
||||
s := 'Hello,How,Are,You,Today';
|
||||
loop for part in tokenize(',', s) do
|
||||
nprint(part + ". ");
|
||||
end loop;
|
||||
print;
|
||||
|
||||
proc tokenize(sep, s);
|
||||
loop
|
||||
init parts := [];
|
||||
doing parts with:= break(s, sep);
|
||||
while s /= ""
|
||||
do
|
||||
s := s(2..);
|
||||
end loop;
|
||||
return parts;
|
||||
end proc;
|
||||
end program;
|
||||
Loading…
Add table
Add a link
Reference in a new issue