LazyCollectionProtocol

protocol LazyCollectionProtocol : Collection, LazySequenceProtocol
  • Creates a lazy sequence by splitting this Collection repeatedly.

    • Parameters:
      • separator: The element of this collection to split over.
      • allowEmptySlices: If there are two or more separators in a row, or this Collection begins or ends with a separator, should empty slices be emitted? Defaults to false.

    Declaration

    Swift

    public func split (
    		separator: Elements.Iterator.Element, allowEmptySlices: Bool = false
    		) -> LazySplitSequence<Elements>

    Parameters

    separator

    The element of this collection to split over.

    allowEmptySlices

    If there are two or more separators in a row, or this Collection begins or ends with a separator, should empty slices be emitted? Defaults to false.