How can I "skip" the first N entries of a kotlin sequence/list?
I am looking for the kotlin equivalent of C# LINQ "skip".
How can I "skip" the first N entries of a kotlin sequence/list?
I am looking for the kotlin equivalent of C# LINQ "skip".
You are probably looking for the "drop" function known for example from from lodash:
val seq = 1..10
seq.drop(5)
> [6, 7, 8, 9, 10]
© 2022 - 2024 — McMap. All rights reserved.
seq
is not aSequence
, but anIntRange
which isIterable
. Neverthelessdrop
extension function is available both forSequence
andIterable
. – Percy