pub fn cutScalar(comptime T: type, haystack: []const T, needle: T) ?struct T: typehaystack: []const Tneedle: T3292
3293
3294
3295pub fn cutScalar(comptime T: type, haystack: []const T, needle: T) ?struct { []const T, []const T } {
const index = findScalar(T, haystack, needle) orelse return null;
return .{ haystack[0..index], haystack[index + 1 ..] };
}
Returns slice of
haystackbefore and after first occurrenceneedle, ornullif not found.See also:
cutsplitScalartokenizeScalar