Strings In Depth16 / 17
Up next

StringBuilder

fun main() {
    val sb = StringBuilder()
    // append returns the builder, so calls chain
    for (i in 1..3) sb.append(i).append(",")
    println(sb.toString())
}
What you're solving

build text without a new String each step