Like print but returned slice has the provided sentinel.
pub fn printSentinel(
buffer: []u8,
comptime format: []const u8,
args: anytype,
comptime sentinel: u8,
) PrintError![:sentinel]u8
pub fn printSentinel(
buffer: []u8,
comptime format: []const u8,
args: anytype,
comptime sentinel: u8,
) PrintError![:sentinel]u8 {
const result = try print(buffer, format ++ [1]u8{sentinel}, args);
return result[0 .. result.len - 1 :sentinel];
}