We break down why string concatenation using
+ and
+= inside loops leads to extra copying, how to efficiently build multi-line text using
StringBuilder (methods
append(),
appendLine(), finalization via
toString()), when it is simpler to use
joinToString(), and which mistakes most often occur when formatting reports and line breaks.