Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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 standard library. Public Function

tokenizeAny

Public Function
std.mem.tokenizeAny
pub fn tokenizeAny(comptime T: type, buffer: []const T, delimiters: []const T) TokenIterator(T, .any)

Returns an iterator that iterates over the slices of buffer that are not any of the items in delimiters.

tokenizeAny(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 none of delimiters exist in buffer, the iterator will return buffer, null, in that order.

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

Params

  • T: type
  • buffer: []const T
  • delimiters: []const T

File

mem.zig:2428
2428
2429
2430
2431
2432
2433
2434
pub fn tokenizeAny(comptime T: type, buffer: []const T, delimiters: []const T) TokenIterator(T, .any) {
    return .{
        .index = 0,
        .buffer = buffer,
        .delimiter = delimiters,
    };
}