Tokenize a string: Difference between revisions
added Zig
(→{{header|Vlang}}: Rename "Vlang" in "V (Vlang)") |
(added Zig) |
||
Line 3,895:
print</syntaxhighlight>
=={{header|Zig}}==
<syntaxhighlight lang="zig">const std = @import("std");
pub fn main() void {
const string = "Hello,How,Are,You,Today";
var tokens = std.mem.split(u8, string, ",");
std.debug.print("{s}", .{tokens.next().?});
while (tokens.next()) |token| {
std.debug.print(".{s}", .{token});
}
}</syntaxhighlight>
=={{header|zkl}}==
<syntaxhighlight lang="zkl">"Hello,How,Are,You,Today".split(",").concat(".").println();
|