takeInPlace

fun <T> List<T>.takeInPlace(n: Int): List<T>(source)

Returns a sublist of the first n elements. The sublist is a view into the original list. Changes in the original list will be reflected in the sublist.

Return

A list containing the first n elements.

Parameters

n

The number of elements to take.