Sequence

extension Sequence
  • Returns the first element where the comparison function returns true or nil if the comparisun functoin always returns false.

    Complexity

    O(self.count).

    Declaration

    Swift

    public func findFirstWhere(_ found: (Iterator.Element) -> Bool) -> Iterator.Element?
  • return a set containing the elements from the given sequence

    Declaration

    Swift

    public var asSet: Set<Iterator.Element> { get }