all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
18
Task/Tokenize-a-string/Modula-3/tokenize-a-string.mod3
Normal file
18
Task/Tokenize-a-string/Modula-3/tokenize-a-string.mod3
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
MODULE Tokenize EXPORTS Main;
|
||||
|
||||
IMPORT IO, TextConv;
|
||||
|
||||
TYPE Texts = REF ARRAY OF TEXT;
|
||||
|
||||
VAR tokens: Texts;
|
||||
string := "Hello,How,Are,You,Today";
|
||||
sep := SET OF CHAR {','};
|
||||
|
||||
BEGIN
|
||||
tokens := NEW(Texts, TextConv.ExplodedSize(string, sep));
|
||||
TextConv.Explode(string, tokens^, sep);
|
||||
FOR i := FIRST(tokens^) TO LAST(tokens^) DO
|
||||
IO.Put(tokens[i] & ".");
|
||||
END;
|
||||
IO.Put("\n");
|
||||
END Tokenize.
|
||||
Loading…
Add table
Add a link
Reference in a new issue