Joining
Join the parts of a collection of collections, providing a connecting element or collection, or a closure that produces the connector.
Joining by an Element
func joined(by: Element.Element
) -> JoinedBySequence<Self, CollectionOfOne<Element.Element>> Returns the concatenation of the elements in this sequence of sequences, inserting the given separator between each sequence.
func joined(by: (Element, Element) throws -> Element.Element
) rethrows -> [Element.Element] Returns the concatenation of the elements in this sequence of sequences, inserting the separator produced by the closure between each sequence.
func joined(by: Element.Element
) -> JoinedByCollection<Self, CollectionOfOne<Element.Element>> Returns the concatenation of the elements in this collection of collections, inserting the given separator between each collection.
func joined(by: @escaping (Element, Element) -> Element.Element
) -> JoinedByClosureCollection<Elements, CollectionOfOne<Element.Element>> Returns the concatenation of the elements in this collection of collections, inserting the separator produced by the closure between each sequence.
func joined<Separator>(by: @escaping (Element, Element) -> Separator
) -> JoinedByClosureSequence<Elements, Separator> Returns the concatenation of the elements in this sequence of sequences, inserting the separator produced by the closure between each sequence.
Joining by a Collection
func joined<Separator>(by: Separator
) -> JoinedBySequence<Self, Separator> Returns the concatenation of the elements in this sequence of sequences, inserting the given separator between each sequence.
func joined<Separator>(by: (Element, Element) throws -> Separator
) rethrows -> [Element.Element] Returns the concatenation of the elements in this sequence of sequences, inserting the separator produced by the closure between each sequence.
func joined<Separator>(by: Separator
) -> JoinedByCollection<Self, Separator> Returns the concatenation of the elements in this collection of collections, inserting the given separator between each collection.
func joined<Separator>(by: @escaping (Element, Element) -> Separator
) -> JoinedByClosureCollection<Elements, Separator> Returns the concatenation of the elements in this collection of collections, inserting the separator produced by the closure between each sequence.
func joined(by: @escaping (Element, Element) -> Element.Element
) -> JoinedByClosureSequence<Elements, CollectionOfOne<Element.Element>> Returns the concatenation of the elements in this sequence of sequences, inserting the separator produced by the closure between each sequence.
Interspersing Elements
func interspersed(with: Element
) -> InterspersedSequence<Self> Returns a sequence containing elements of this sequence with the given separator inserted in between each element.
Supporting Types
struct JoinedBySequence<Base, Separator>
A sequence that presents the elements of a base sequence of sequences concatenated using a given separator.
struct JoinedByCollection<Base, Separator>
A collection that presents the elements of a base collection of collections concatenated using a given separator.
struct JoinedByClosureSequence<Base, Separator>
A sequence that presents the elements of a base sequence of sequences concatenated using a given separator that depends on the sequences right before and after it.
struct JoinedByClosureCollection<Base, Separator>
A collection that presents the elements of a base collection of collections concatenated using a given separator that depends on the collections right before and after it.
struct InterspersedSequence<Base>
A sequence that presents the elements of a base sequence of elements with a separator between each of those elements.