Tokenize a string: Difference between revisions

Content added Content deleted
(Added Lua version)
(→‎{{header|Lua}}: Changed to use in-built table.concat function)
Line 971: Line 971:


local str = "Hello,How,Are,You,Today"
local str = "Hello,How,Are,You,Today"
table.foreach(str:split(","), print)</lang>
print(table.concat(str:split(","), "."))</lang>
{{out}}
{{out}}
<pre>1 Hello
<pre>Hello.How.Are.You.Today</pre>
2 How
3 Are
4 You
5 Today</pre>


=={{header|K}}==
=={{header|K}}==