Generic Structure
ReversedCollection
A collection that presents the elements of its base collection in reverse order.
Overview
The reversed() method is always lazy when applied to a collection with bidirectional indices, but does not implicitly confer laziness on algorithms applied to its result. In other words, for ordinary collections c having bidirectional indices:
c.reversed() does not create new storage
c.reversed().map(f) maps eagerly and returns a new array
c.lazy.reversed().map(f) maps lazily and returns a LazyMapCollection
Topics
Instance Methods
func joined(separator: String) -> StringReturns a new string by concatenating the elements of the sequence, adding the given separator between each element.
Available when Element conforms to StringProtocol.
See Also
Wrappers for Algorithms
struct DropFirstSequenceA sequence that lazily consumes and drops n elements from an underlying Base iterator before possibly returning the first available element.
struct DropWhileSequenceA sequence that lazily consumes and drops n elements from an underlying Base iterator before possibly returning the first available element.
struct FlattenSequenceA sequence consisting of all the elements contained in each segment contained in some Base sequence.
struct JoinedSequenceA sequence that presents the elements of a base sequence of sequences concatenated using a given separator.
struct StrideToA sequence of values formed by striding over a half-open interval.
struct UnfoldSequenceA sequence whose elements are produced via repeated applications of a closure to some mutable state.