Back to course

Standard Library: Iterators

Full Course: Zig Programming From Zero to Hero

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| { // ... }