Divide um texto usando separadores e fornece seus pedaços
Chunks = tokens(text) Chunks = tokens(text, separators)
[" ",ascii(9)],
ascii(9) sendo a tabulação horizontal.
tokens(…) pesquisa no texto os separadores fornecidos,
e divide em pedaços. Os pedaços são sem separadores.
Separadores consecutivos são mesclados.
tokens("The given text") tokens("SCI/demos/scicos", "/")' tokens("Επιστήμη και καινοτομία", ["α"," "])' nbsp = ascii(160); // non-breakable space t = "the" + nbsp + "given text" tokens(t) | ![]() | ![]() |
--> tokens('The given text')
ans =
"The"
"given"
"text"
--> tokens('SCI/demos/scicos', '/')'
ans =
"SCI" "demos" "scicos"
--> tokens("Επιστήμη και καινοτομία", ["α"," "])'
ans =
"Επιστήμη" "κ" "ι" "κ" "ινοτομί"
--> nbsp = ascii(160); // non-breakable space
--> t = "the" + nbsp + "given text"
t =
"the given text"
--> tokens(t)
ans =
"the given"
"text"