pub fn cutLast(comptime T: type, haystack: []const T, needle: []const T) ?struct T: typehaystack: []const Tneedle: []const T3273
3274
3275
3276pub fn cutLast(comptime T: type, haystack: []const T, needle: []const T) ?struct { []const T, []const T } {
const index = findLast(T, haystack, needle) orelse return null;
return .{ haystack[0..index], haystack[index + needle.len ..] };
}
Returns slice of
haystackbefore and after last occurrence ofneedle, ornullif not found.See also:
cutcutScalarLast