libtmux Reference MCP Search
On this page

ControlNotificationStream.dropFirst(_:)

View as Markdown

Declared in
ControlNotificationStream
Package
libtmux-swift
dropFirst(_:) ( count : Int ) AsyncDropFirstSequence<Self>
method [source]
method [source]
dropFirst(_:)

Omits a specified number of elements from the base asynchronous sequence, then passes through all remaining elements.

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 Counter produces Int values from 1 to 10. The dropFirst(_:) method causes the modified sequence to ignore the values 1 through 3, and instead emit 4 through 10:

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. count must be greater than or equal to zero.
  • Returns: An asynchronous sequence that drops the first count elements from the base sequence.

0 declared, 0 inherited

Esc

Type to search.