haystack before reaching an element for which startsWith!pred(haystack, needles) is true.
- If
startsWith!pred(haystack, needles)is nottruefor any element inhaystack, then-1is returned. - If more than one needle is provided,
countUntilwill wrap the result in a pseudo-tuple similar toTuple!(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.