LazySplitSequence

public struct LazySplitSequence <Base: Collection>: IteratorProtocol, LazySequenceProtocol where
	Base.Element: Equatable

A sequence from splitting a Collection lazily.

  • Undocumented

    Declaration

    Swift

    public fileprivate(set) var remaining: Base.SubSequence? {
      get
      }
  • Undocumented

    Declaration

    Swift

    public let separator: Base.Element
  • Undocumented

    Declaration

    Swift

    public let allowEmptySlices: Bool
  • Creates a lazy sequence by splitting a Collection repeatedly.

    Declaration

    Swift

    public init(_ base: Base, separator: Base.Element, allowEmptySlices: Bool = false)

    Parameters

    base

    The Collection to split.

    separator

    The element of base to split over.

    allowEmptySlices

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

  • The contents of ‘base’ up to the next occurrence of ‘separator’.

    Declaration

    Swift

    public mutating func next() -> Base.SubSequence?