Anonymous user
Repeat a string: Difference between revisions
→{{header|Kotlin}}
Line 963:
println("ha".repeat(5))
}
</lang>
Or more fancy:
<lang Kotlin>
operator fun String.times(n: Int) = this.repeat(n)
fun main(args: Array<String>) = println("ha" * 5)
</lang>
|