Back to Swift Algorithms

Selecting Elements

Sources/Algorithms/Documentation.docc/Selecting.md

1.2.1521 B
Original Source

Selecting Elements

Select elements at a particular interval, the first mapped value, or iterate of elements with their indices.

Topics

Selecting Elements at an Interval

  • Swift/Sequence/striding(by:)
  • Swift/Collection/striding(by:)

Conditionally Finding the First Mapped Value

  • Swift/Sequence/firstNonNil(_:)

Iterating Over Elements with Their Indices

  • Swift/Collection/indexed()

Supporting Types

  • IndexedCollection
  • StridingSequence
  • StridingCollection