Playing with operators

Report a typo

What will the following code print?

operator fun StringBuilder.timesAssign(n: Int) {
    this.append(this.toString().repeat(n - 1))
}

fun main() {
    val sb = StringBuilder("Kotlin")
    sb *= 3
    println(sb)
}
Enter a short text
___

Create a free account to access the full topic