pub fn findNonePos(comptime T: type, slice: []const T, start_index: usize, values: []const T) ?usize T: typeslice: []const Tstart_index: usizevalues: []const T1424
1425
1426
1427
1428
1429
1430
1431
1432
1433pub fn findNonePos(comptime T: type, slice: []const T, start_index: usize, values: []const T) ?usize {
if (start_index >= slice.len) return null;
outer: for (slice[start_index..], start_index..) |c, i| {
for (values) |value| {
if (c == value) continue :outer;
}
return i;
}
return null;
}
Find the first item in
slice[start_index..]which is not contained invalues. The returned index will be relative to the start ofslice, and never less thanstart_index.Comparable to
strspnin the C standard library.