W3cubDocs

/Kotlin

toTypedArray

inline fun <reified T> Collection<T>.toTypedArray(): Array<T>

Returns a typed array containing all of the elements of this collection.

Allocates an array of runtime type T having its size equal to the size of this collection and populates the array with the elements of this collection.

fun ByteArray.toTypedArray(): Array<Byte>
fun ShortArray.toTypedArray(): Array<Short>
fun IntArray.toTypedArray(): Array<Int>
fun LongArray.toTypedArray(): Array<Long>
fun FloatArray.toTypedArray(): Array<Float>
fun DoubleArray.toTypedArray(): Array<Double>
fun BooleanArray.toTypedArray(): Array<Boolean>
fun CharArray.toTypedArray(): Array<Char>

Returns a typed object array containing all of the elements of this primitive array.

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/to-typed-array.html