pub fn findLastNone(comptime T: type, slice: []const T, values: []const T) ?usize T: typeslice: []const Tvalues: []const T1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416pub fn findLastNone(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;
}
Find the last item in
slicewhich is not contained invalues.Like
strspnin the C standard library, but searches from the end.