contentToString

Common
JVM
JS
Native
1.4
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
}
Common
JVM
JS
Native
1.4
@ExperimentalUnsignedTypes fun UIntArray?.contentToString(): String
(source)
Common
JVM
JS
Native
1.4
@ExperimentalUnsignedTypes fun ULongArray?.contentToString(): String
(source)
Common
JVM
JS
Native
1.4
@ExperimentalUnsignedTypes fun UByteArray?.contentToString(): String
(source)
Common
JVM
JS
Native
1.4
@ExperimentalUnsignedTypes fun UShortArray?.contentToString(): String
(source)
Native
1.1
@DeprecatedSinceKotlin("1.4") fun <T> Array<out T>.contentToString(): String
(source)
Deprecated: Use Kotlin compiler 1.4 to avoid deprecation warning.
Native
1.1
@DeprecatedSinceKotlin("1.4") fun ByteArray.contentToString(): String
(source)
Deprecated: Use Kotlin compiler 1.4 to avoid deprecation warning.
Native
1.1
@DeprecatedSinceKotlin("1.4") fun ShortArray.contentToString(): String
(source)
Deprecated: Use Kotlin compiler 1.4 to avoid deprecation warning.
Native
1.1
@DeprecatedSinceKotlin("1.4") fun IntArray.contentToString(): String
(source)
Deprecated: Use Kotlin compiler 1.4 to avoid deprecation warning.
Native
1.1
@DeprecatedSinceKotlin("1.4") fun LongArray.contentToString(): String
(source)
Deprecated: Use Kotlin compiler 1.4 to avoid deprecation warning.
Native
1.1
@DeprecatedSinceKotlin("1.4") fun FloatArray.contentToString(): String
(source)
Deprecated: Use Kotlin compiler 1.4 to avoid deprecation warning.
Native
1.1
@DeprecatedSinceKotlin("1.4") fun DoubleArray.contentToString(): String
(source)
Deprecated: Use Kotlin compiler 1.4 to avoid deprecation warning.
Native
1.1
@DeprecatedSinceKotlin("1.4") fun BooleanArray.contentToString(): String
(source)
Deprecated: Use Kotlin compiler 1.4 to avoid deprecation warning.
Native
1.1
@DeprecatedSinceKotlin("1.4") fun CharArray.contentToString(): String
(source)
Deprecated: Use Kotlin compiler 1.4 to avoid deprecation warning.
Native
1.3
@DeprecatedSinceKotlin("1.4") @ExperimentalUnsignedTypes fun UIntArray.contentToString(): String
(source)
Deprecated: Use Kotlin compiler 1.4 to avoid deprecation warning.
Native
1.3
@DeprecatedSinceKotlin("1.4") @ExperimentalUnsignedTypes fun ULongArray.contentToString(): String
(source)
Deprecated: Use Kotlin compiler 1.4 to avoid deprecation warning.
Native
1.3
@DeprecatedSinceKotlin("1.4") @ExperimentalUnsignedTypes fun UByteArray.contentToString(): String
(source)
Deprecated: Use Kotlin compiler 1.4 to avoid deprecation warning.
Native
1.3
@DeprecatedSinceKotlin("1.4") @ExperimentalUnsignedTypes fun UShortArray.contentToString(): String
(source)
Deprecated: Use Kotlin compiler 1.4 to avoid deprecation warning.

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
}