times

operator fun String.times(n: Int): String

Returns a string containing this char sequence repeated n times.

Example:

"^" * 5 // "^^^^^"
"hi" * 0 // ""
"error" * -1 // IllegalArgumentException

Since

1.1.0

See also

repeat

Throws

IllegalArgumentException

when n < 0.


operator fun Char.times(n: Int): String

Returns a string containing this char repeated n times.

Example:

'a' * 5 // "aaaaa"
'a' * 0 // ""
'a' * -1 // IllegalArgumentException

Since

1.1.0

See also

Throws

IllegalArgumentException

when n < 0.