pub fn cutScalarLast(comptime T: type, haystack: []const T, needle: T) ?struct T: typehaystack: []const Tneedle: T3311
3312
3313
3314pub fn cutScalarLast(comptime T: type, haystack: []const T, needle: T) ?struct { []const T, []const T } {
const index = findScalarLast(T, haystack, needle) orelse return null;
return .{ haystack[0..index], haystack[index + 1 ..] };
}
Returns slice of
haystackbefore and after last occurrence ofneedle, ornullif not found.See also:
cutsplitScalartokenizeScalar