pub fn printSentinel(
buffer: []u8,
comptime format: []const u8,
args: anytype,
comptime sentinel: u8,
) PrintError![:sentinel]u8 buffer: []u8format: []const u8argssentinel: u8NoSpaceLeftAs much as possible was written to the buffer, but it was too small to fit all the printed bytes.
5226
5227
5228
5229
5230
5231
5232
5233
5234pub 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];
}
Like
printbut returned slice has the provided sentinel.