Data update
This commit is contained in:
parent
8e4e15fa56
commit
72eb4943cb
1853 changed files with 35514 additions and 9441 deletions
24
Task/Tokenize-a-string/Draco/tokenize-a-string.draco
Normal file
24
Task/Tokenize-a-string/Draco/tokenize-a-string.draco
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
proc tokenize(char sep; *char str; [*]*char parts) word:
|
||||
word n;
|
||||
n := 0;
|
||||
while
|
||||
parts[n] := str;
|
||||
while str* /= sep and str* /= '\e' do str := str + 1 od;
|
||||
n := n+1;
|
||||
str* /= '\e'
|
||||
do
|
||||
str* := '\e';
|
||||
str := str + 1
|
||||
od;
|
||||
n
|
||||
corp
|
||||
|
||||
proc main() void:
|
||||
word i, count;
|
||||
[10]*char parts;
|
||||
count := tokenize(',', "Hello,How,Are,You,Today", parts);
|
||||
for i from 0 upto count-1 do
|
||||
write(parts[i], ". ")
|
||||
od;
|
||||
writeln()
|
||||
corp
|
||||
Loading…
Add table
Add a link
Reference in a new issue