StringBuilder and buildString
Use StringBuilder or buildString for many appends.
Example
val s = buildString {
for (i in 1..3) append(i).append(",")
setLength(length - 1)
}
println(s)Exercise
Build text.
String { append("x") }Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.