Iterators
Many types in the standard library use the iterator pattern (a next() method returning an optional).
zig var iter = std.mem.split(u8, "a,b,c", ","); while (iter.next()) |part| { // ... }
Full Course: Zig Programming From Zero to Hero
Many types in the standard library use the iterator pattern (a next() method returning an optional).
zig var iter = std.mem.split(u8, "a,b,c", ","); while (iter.next()) |part| { // ... }