Take

Take is the opposite of the drop function. It takes the first n elements from the collection:

val numbers = listOf(1, 2, 3, 4, 5)
val first2 = numbers.take(2)

The first2 list now has [1, 2].

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.177.222