sliceArray

fun <T> Array<T>.sliceArray(indices: Collection<Int>): Array<T>
fun ByteArray.sliceArray(indices: Collection<Int>): ByteArray
fun ShortArray.sliceArray(indices: Collection<Int>): ShortArray
fun IntArray.sliceArray(indices: Collection<Int>): IntArray
fun LongArray.sliceArray(indices: Collection<Int>): LongArray
fun FloatArray.sliceArray(indices: Collection<Int>): FloatArray
fun DoubleArray.sliceArray(indices: Collection<Int>): DoubleArray
fun BooleanArray.sliceArray(indices: Collection<Int>): BooleanArray
fun CharArray.sliceArray(indices: Collection<Int>): CharArray

Returns an array containing elements of this array at specified indices.


fun <T> Array<T>.sliceArray(indices: IntRange): Array<T>
fun ByteArray.sliceArray(indices: IntRange): ByteArray
fun ShortArray.sliceArray(indices: IntRange): ShortArray
fun IntArray.sliceArray(indices: IntRange): IntArray
fun LongArray.sliceArray(indices: IntRange): LongArray
fun FloatArray.sliceArray(indices: IntRange): FloatArray
fun DoubleArray.sliceArray(indices: IntRange): DoubleArray
fun BooleanArray.sliceArray(indices: IntRange): BooleanArray
fun CharArray.sliceArray(indices: IntRange): CharArray

Returns an array containing elements at indices in the specified indices range.


fun UIntArray.sliceArray(indices: Collection<Int>): UIntArray
fun ULongArray.sliceArray(indices: Collection<Int>): ULongArray
fun UByteArray.sliceArray(indices: Collection<Int>): UByteArray
fun UShortArray.sliceArray(indices: Collection<Int>): UShortArray

Returns an array containing elements of this array at specified indices.

Since Kotlin

1.3

fun UIntArray.sliceArray(indices: IntRange): UIntArray
fun ULongArray.sliceArray(indices: IntRange): ULongArray
fun UByteArray.sliceArray(indices: IntRange): UByteArray
fun UShortArray.sliceArray(indices: IntRange): UShortArray

Returns an array containing elements at indices in the specified indices range.

Since Kotlin

1.3