pub fn replaceOwned(comptime T: type, allocator: Allocator, input: []const T, needle: []const T, replacement: []const T) Allocator.Error![]T
Perform a replacement on an allocated buffer of pre-determined size. Caller must free returned memory.
T: type
allocator: Allocator
input: []const T
needle: []const T
replacement: []const T
4230 4231 4232 4233 4234
pub fn replaceOwned(comptime T: type, allocator: Allocator, input: []const T, needle: []const T, replacement: []const T) Allocator.Error![]T { const output = try allocator.alloc(T, replacementSize(T, input, needle, replacement)); _ = replace(T, input, needle, replacement, output); return output; }
Perform a replacement on an allocated buffer of pre-determined size. Caller must free returned memory.