Instance Methodswift 6.0.1Swift

    prefix(while:)

    Returns a subsequence containing the initial elements until predicate returns false and skipping the remaining elements.

    func prefix(while predicate: (Self.Element) throws -> Bool) rethrows -> Self.SubSequence

    Parameters

    predicate

    A closure that takes an element of the sequence as its argument and returns true if the element should be included or false if it should be excluded. Once the predicate returns false it will not be called again.

    Other members in extension

    Typealiases

    Show obsolete interfaces (1)

    Hide obsolete interfaces

    Instance members

    Show obsolete interfaces (6)

    Hide obsolete interfaces