Strings In Depth9 / 19
Up next

Prefix and suffix

const std = @import("std");

pub fn main() void {
    const path = "image.png";
    std.debug.print("{}\n", .{std.mem.startsWith(u8, path, "image")});
    std.debug.print("{}\n", .{std.mem.endsWith(u8, path, ".png")});
}
What you're solving

startsWith and endsWith checks