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)
}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)
}Create a free account to access the full topic