Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

tokenizeScalar

Returns an iterator that iterates over the slices of buffer that are not delimiter.

tokenizeScalar(u8, " abc def ghi ", ' ') will return slices for "abc", "def", "ghi", null, in that order.

If buffer is empty, the iterator will return null. If delimiter does not exist in buffer, the iterator will return buffer, null, in that order.

See also: tokenizeAny, tokenizeSequence, splitSequence,splitAny, and splitScalar splitBackwardsSequence, splitBackwardsAny, and splitBackwardsScalar

mem.tokenizeScalar
pub fn tokenizeScalar(comptime T: type, buffer: []const T, delimiter: T) TokenIterator(T, .scalar)

File

lib/std/mem.zig:2438

Code

pub fn tokenizeScalar(comptime T: type, buffer: []const T, delimiter: T) TokenIterator(T, .scalar) {
    return .{
        .index = 0,
        .buffer = buffer,
        .delimiter = delimiter,
    };
}