Spec-Zone.ru › Kotlin 2

sliceArray

kotlin-stdlib/kotlin.collections/sliceArray

Начиная с Kotlin: 1.0

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

Возвращает массив, содержащий элементы этого массива с указанными индексами.


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

Возвращает массив, содержащий элементы с индексами из указанного диапазона индексов.


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

Возвращает массив, содержащий элементы этого массива с указанными индексами.


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

Возвращает массив, содержащий элементы с индексами из указанного диапазона индексов.

© 2010–2026 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/slice-array.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API