repeat
Returns a string containing this char sequence repeated n times.
Since Kotlin
1.0Throws
when n < 0.
Samples
import java.util.Locale
import kotlin.test.*
fun main() {
//sampleStart
println("Word".repeat(4)) // WordWordWordWord
println("Word".repeat(0)) //
//sampleEnd
}
Returns a string containing this char sequence repeated n times.
Since Kotlin
1.1Throws
when n < 0.
Samples
import java.util.Locale
import kotlin.test.*
fun main() {
//sampleStart
println("Word".repeat(4)) // WordWordWordWord
println("Word".repeat(0)) //
//sampleEnd
}
Returns a string containing this char sequence repeated n times.
Since Kotlin
1.0Throws
when n < 0.
Samples
import java.util.Locale
import kotlin.test.*
fun main() {
//sampleStart
println("Word".repeat(4)) // WordWordWordWord
println("Word".repeat(0)) //
//sampleEnd
}
Returns a string containing this char sequence repeated n times.
Since Kotlin
1.3Throws
when n < 0.
Samples
import java.util.Locale
import kotlin.test.*
fun main() {
//sampleStart
println("Word".repeat(4)) // WordWordWordWord
println("Word".repeat(0)) //
//sampleEnd
}