slice

fun <T> Array<out T>.slice(indices: IntRange): List<T>(source)
fun <T> List<T>.slice(indices: IntRange): List<T>(source)

Returns a list containing elements at indices in the specified indices range.

Since Kotlin

1.0

fun <T> Array<out T>.slice(indices: Iterable<Int>): List<T>(source)
fun <T> List<T>.slice(indices: Iterable<Int>): List<T>(source)

Returns a list containing elements at specified indices.

Since Kotlin

1.0