W3cubDocs

/Kotlin

buildString

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
inline fun buildString(
    builderAction: StringBuilder.() -> Unit
): String

Builds new string by populating newly created StringBuilder using provided builderAction and then converting it to String.

Platform and version requirements: JVM (1.1), JS (1.1), Native (1.1)
inline fun buildString(
    capacity: Int, 
    builderAction: StringBuilder.() -> Unit
): String

Builds new string by populating newly created StringBuilder initialized with the given capacity using provided builderAction and then converting it to String.

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/build-string.html