BidirectionalCollection

extension BidirectionalCollection
  • Trims the suffix where the found function/closure keeps returning true

    Complexity

    O(self.count).

    Declaration

    Swift

    public func trimWhile(_ found: (Iterator.Element) -> Bool) -> SubSequence