Strings In Depth4 / 19
Up next

Find a single byte

const std = @import("std");

pub fn main() void {
    const s = "a=b=c";
    // indexOfScalar searches for a single byte value
    const first = std.mem.indexOfScalar(u8, s, '=');
    std.debug.print("{?}\n", .{first});
}
What you're solving

std.mem.indexOfScalar locates one byte