I have the following method that I used a bunch of...
# stdlib
x
I have the following method that I used a bunch of times already, which could find it's place in the stdlib maybe :
Copy code
operator fun Char.times(i: Int): String {
    check(i >= 0) { "Can't repeat character negative times " }
    return String(CharArray(i) { this })
}

val s = '_' * 8
👌 3
d
val s = "_".repeat(8)
is already in the stdlib
☝🏼 6
n
so
operator fun Char.times(n: Int) = this.toString().repeat(n)
nice.
👍 1