contentToString
fun <T> Array<out T>?.contentToString(): String
(Common source) (JVM source) (JS source) (Native source)
Returns a string representation of the contents of the specified array as if it is List.
import kotlin.test.*
fun main(args: Array<String>) {
//sampleStart
val array = arrayOf("apples", "oranges", "lime")
println(array.contentToString()) // [apples, oranges, lime]
//sampleEnd
}
@DeprecatedSinceKotlin("1.4") @ExperimentalUnsignedTypes fun ULongArray.contentToString(): String
(source)
@DeprecatedSinceKotlin("1.4") @ExperimentalUnsignedTypes fun UByteArray.contentToString(): String
(source)
@DeprecatedSinceKotlin("1.4") @ExperimentalUnsignedTypes fun UShortArray.contentToString(): String
(source)
Returns a string representation of the contents of the specified array as if it is List.
import kotlin.test.*
fun main(args: Array<String>) {
//sampleStart
val array = arrayOf("apples", "oranges", "lime")
println(array.contentToString()) // [apples, oranges, lime]
//sampleEnd
}