Function lastIndexOfAny [src]
Linear search for the last index of any value in the provided list inside a slice.
Returns null if no values are found.
Prototype
pub fn lastIndexOfAny(comptime T: type, slice: []const T, values: []const T) ?usize Parameters
T: typeslice: []const Tvalues: []const T Source
pub fn lastIndexOfAny(comptime T: type, slice: []const T, values: []const T) ?usize {
var i: usize = slice.len;
while (i != 0) {
i -= 1;
for (values) |value| {
if (slice[i] == value) return i;
}
}
return null;
}