Function lastIndexOfNone [src]
Find the last item in slice which is not contained in values.
Like strspn in the C standard library, but searches from the end.
Prototype
pub fn lastIndexOfNone(comptime T: type, slice: []const T, values: []const T) ?usize
Parameters
T: type
slice: []const T
values: []const T
Source
pub fn lastIndexOfNone(comptime T: type, slice: []const T, values: []const T) ?usize {
var i: usize = slice.len;
outer: while (i != 0) {
i -= 1;
for (values) |value| {
if (slice[i] == value) continue :outer;
}
return i;
}
return null;
}