indent

inline fun StringBuilder.indent(leadingIndent: String = " ", continuationIndent: String = leadingIndent, builder: StringBuilder.() -> Unit)(source)

example:

override fun toString() = buildString {
appendLine("SomeClass(")
indent {
appendLine("prop1=$prop1")
appendLine("prop2=$prop2")
}
appendLine(")")
}