← Back to archive

Stdle #144 · strings · 2026-10-28

What does this Zig snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

const std = @import("std");
pub fn main() void {
const s: []const u8 = "zigzag";
std.debug.print("{}\n", .{std.mem.startsWith(u8, s, "zig")});
std.debug.print("{}\n", .{std.mem.endsWith(u8, s, "zig")});
}
Strings
2 lines
4 attempts left

Answer & explanation