Spec-Zone.ru › Kotlin 2

slice

kotlin-stdlib/kotlin.collections/slice

Начиная с Kotlin: 1.0

fun <T> Array<out T>.slice(indices: IntRange): List<T>
fun ByteArray.slice(indices: IntRange): List<Byte>
fun ShortArray.slice(indices: IntRange): List<Short>
fun IntArray.slice(indices: IntRange): List<Int>
fun LongArray.slice(indices: IntRange): List<Long>
fun FloatArray.slice(indices: IntRange): List<Float>
fun DoubleArray.slice(indices: IntRange): List<Double>
fun BooleanArray.slice(indices: IntRange): List<Boolean>
fun CharArray.slice(indices: IntRange): List<Char>
fun <T> List<T>.slice(indices: IntRange): List<T>

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


fun <T> Array<out T>.slice(indices: Iterable<Int>): List<T>
fun ByteArray.slice(indices: Iterable<Int>): List<Byte>
fun ShortArray.slice(indices: Iterable<Int>): List<Short>
fun IntArray.slice(indices: Iterable<Int>): List<Int>
fun LongArray.slice(indices: Iterable<Int>): List<Long>
fun FloatArray.slice(indices: Iterable<Int>): List<Float>
fun DoubleArray.slice(indices: Iterable<Int>): List<Double>
fun BooleanArray.slice(indices: Iterable<Int>): List<Boolean>
fun CharArray.slice(indices: Iterable<Int>): List<Char>
fun <T> List<T>.slice(indices: Iterable<Int>): List<T>

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


@ExperimentalUnsignedTypes
fun UIntArray.slice(indices: IntRange): List<UInt>
@ExperimentalUnsignedTypes
fun ULongArray.slice(indices: IntRange): List<ULong>
@ExperimentalUnsignedTypes
fun UByteArray.slice(indices: IntRange): List<UByte>
@ExperimentalUnsignedTypes
fun UShortArray.slice(indices: IntRange): List<UShort>

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


@ExperimentalUnsignedTypes
fun UIntArray.slice(indices: Iterable<Int>): List<UInt>
@ExperimentalUnsignedTypes
fun ULongArray.slice(indices: Iterable<Int>): List<ULong>
@ExperimentalUnsignedTypes
fun UByteArray.slice(indices: Iterable<Int>): List<UByte>
@ExperimentalUnsignedTypes
fun UShortArray.slice(indices: Iterable<Int>): List<UShort>

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

© 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.html

Spec-Zone.ru

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