このページはまだ翻訳されていないため、英語で表示されます。 翻訳に参加する

skip

Returns a lazy iterable that skips the first length values.

Iterable<A> skip<A>(int length, Iterable<A> iterable) FxAsyncIterable<A> skipAsync<A>(int length, FxAsyncIterable<A> iterable) Fx<T> Fx.skip(int count) // chain FxAsync<T> FxAsync.skip(int count) Iterable<A> drop<A>(...) // FxTS alias FxEvents<T> FxEvents<T>.drop(int count) / .skip(int count) // chain (events)

Lecture

skip is take's opposite: it discards the first length values and yields everything after them. It's still lazy — nothing is skipped until the pipeline is actually pulled — and it works fine on infinite sources, since it only needs to count off a fixed number of elements before passing the rest straight through.

skip is the Dart-idiomatic name, matching Dart's own Iterable.skip (FxDart's Fx already extends Iterable); fxdart also accepts the FxTS spelling drop — they're the same operator.

Demo 1 · Basics

Demo 2 · Async, with concurrency

Try it yourself

Exercise: skip the first 2 header lines.

Related: take — the opposite, keep the first n · dropRight — drop from the end · dropWhile — drop by predicate · slice — arbitrary index window