LazyCollectionProtocol

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

    Declaration

    Swift

    public func split(
    	separator: Elements.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.