Anonymous user
Tokenize a string: Difference between revisions
m
→{{header|BaCon}}
Line 760:
==={{header|BaCon}}===
BaCon includes extensive support for ''delimited strings''.
<lang bacon>
string$ = "Hello,How,Are,You,Today"
' Tokenize a string into an array
SPLIT string$ BY "," TO
' Print array elements with new delimiter
PRINT COIL$(i, UBOUND(array$), array$[i], ".")
'
PRINT DELIM$(string$, ",", ".")</lang>
{{out}}
<pre>prompt$ ./tokenize
Hello.How.Are.You.Today
Hello.How.Are.You.Today</pre>
|