endOfPrefix(while:)

Returns the exclusive upper bound of the prefix of elements that satisfy the predicate.

Suffix.swift:49
func endOfPrefix(while predicate: (Element) throws -> Bool) rethrows -> Index

Parameters

predicate

A closure that takes an element of the collection as its argument and returns true if the element is part of the prefix or false if it is not. Once the predicate returns false it will not be called again.