Returns the index of the sentinel value in a sentinel-terminated pointer. Linear search through memory until the sentinel is found.
pub fn findSentinel(comptime T: type, comptime sentinel: T, p: [*:sentinel]const T) usize
pub fn findSentinel(comptime T: type, comptime sentinel: T, p: [*:sentinel]const T) usize {
var i: usize = 0;
while (p[i] != sentinel) {
i += 1;
}
return i;
}