haystack before reaching an element for which
!pred(haystack, needles) is true.
- If
startsWith!pred(haystack, needles) is not true for any element in haystack, then -1 is returned.
- If more than one needle is provided,
countUntil will wrap the result in a pseudo-tuple similar to Tuple!(ptrdiff_t, "steps", ptrdiff_t, "needle").
stepsis the count value, which can be implicitly tested for equality.needleis the index intoneedleswhich matched.- Both are
-1if there was no match.
Warning: Due to auto-decoding, the return value of this function may not correspond to the array index for strings. To find the index of an element matching the predicate in a string, use indexOf instead.