const std = @import("std"); pub fn main() void { const s = "hello"; // slicing is by byte offset; end is excluded const hi = s[0..2]; std.debug.print("{s}\n", .{hi}); }
s[a..b] indexes bytes, half-open