ControlNotificationStream.dropFirst(_:)
Omits a specified number of elements from the base asynchronous sequence, then passes through all remaining elements.
Source and package
- Qualified name
-
ControlNotification Stream. drop First(_:) - Declared in
ControlNotificationStream- Package
- libtmux-swift
-
Inherited from
AsyncSequence.dropFirst(_:)Description#
Use
dropFirst(_:)when you want to drop the first n elements from the base sequence and pass through the remaining elements.In this example, an asynchronous sequence called
CounterproducesIntvalues from1to10. ThedropFirst(_:)method causes the modified sequence to ignore the values1through3, and instead emit4through10:for await number in Counter(howHigh: 10).dropFirst(3) { print(number, terminator: " ") } // Prints "4 5 6 7 8 9 10 "
If the number of elements to drop exceeds the number of elements in the sequence, the result is an empty sequence.
- Parameter count: The number of elements to drop from the beginning of the sequence.
countmust be greater than or equal to zero. - Returns: An asynchronous sequence that drops the first
countelements from the base sequence.
- Parameter count: The number of elements to drop from the beginning of the sequence.