Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kotlin sequence "skip" first N entries

How can I "skip" the first N entries of a kotlin sequence/list?

I am looking for the kotlin equivalent of C# LINQ "skip".

like image 537
GameScripting Avatar asked Apr 26 '17 08:04

GameScripting


1 Answers

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]
like image 156
GameScripting Avatar answered Oct 22 '22 13:10

GameScripting