flatMap
inline fun <R> ShortArray.flatMap(
transform: (Short) -> Iterable<R>
): List<R>
inline fun <R> FloatArray.flatMap(
transform: (Float) -> Iterable<R>
): List<R>
inline fun <R> DoubleArray.flatMap(
transform: (Double) -> Iterable<R>
): List<R>
inline fun <R> BooleanArray.flatMap(
transform: (Boolean) -> Iterable<R>
): List<R>
@ExperimentalUnsignedTypes inline fun <R> ULongArray.flatMap(
transform: (ULong) -> Iterable<R>
): List<R>
@ExperimentalUnsignedTypes inline fun <R> UByteArray.flatMap(
transform: (UByte) -> Iterable<R>
): List<R>
@ExperimentalUnsignedTypes inline fun <R> UShortArray.flatMap(
transform: (UShort) -> Iterable<R>
): List<R>
Returns a single list of all elements yielded from results of transform function being invoked on each element of original array.
import kotlin.test.*
fun main(args: Array<String>) {
//sampleStart
val list = listOf("123", "45")
println(list.flatMap { it.toList() }) // [1, 2, 3, 4, 5]
//sampleEnd
}
Returns a single list of all elements yielded from results of transform function being invoked on each element of original collection.
import kotlin.test.*
fun main(args: Array<String>) {
//sampleStart
val list = listOf("123", "45")
println(list.flatMap { it.toList() }) // [1, 2, 3, 4, 5]
//sampleEnd
}
Returns a single list of all elements yielded from results of transform function being invoked on each entry of original map.
import kotlin.test.*
fun main(args: Array<String>) {
//sampleStart
val list = listOf("123", "45")
println(list.flatMap { it.toList() }) // [1, 2, 3, 4, 5]
//sampleEnd
}