W3cubDocs

/Kotlin

contentToString

inline fun <T> Array<out T>.contentToString(): String

Platform and version requirements: Kotlin 1.1

inline fun ByteArray.contentToString(): String

Platform and version requirements: Kotlin 1.1

inline fun ShortArray.contentToString(): String

Platform and version requirements: Kotlin 1.1

inline fun IntArray.contentToString(): String

Platform and version requirements: Kotlin 1.1

inline fun LongArray.contentToString(): String

Platform and version requirements: Kotlin 1.1

inline fun FloatArray.contentToString(): String

Platform and version requirements: Kotlin 1.1

inline fun DoubleArray.contentToString(): String

Platform and version requirements: Kotlin 1.1

inline fun BooleanArray.contentToString(): String

Platform and version requirements: Kotlin 1.1

inline fun CharArray.contentToString(): String

Platform and version requirements: Kotlin 1.1

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
}

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