repeat

Returns a string containing this char sequence repeated n times.

Samples



import java.util.Locale


import kotlin.test.*
fun main() { 
   //sampleStart 
   println("Word".repeat(4)) // WordWordWordWord
println("Word".repeat(0)) // 
   //sampleEnd
}

Throws

Returns a string containing this char sequence repeated n times.

Samples



import java.util.Locale


import kotlin.test.*
fun main() { 
   //sampleStart 
   println("Word".repeat(4)) // WordWordWordWord
println("Word".repeat(0)) // 
   //sampleEnd
}

Throws

actual fun CharSequence.repeat(n: Int): String

Returns a string containing this char sequence repeated n times.

Samples



import java.util.Locale


import kotlin.test.*
fun main() { 
   //sampleStart 
   println("Word".repeat(4)) // WordWordWordWord
println("Word".repeat(0)) // 
   //sampleEnd
}

Throws

actual fun CharSequence.repeat(n: Int): String

Returns a string containing this char sequence repeated n times.

Samples



import java.util.Locale


import kotlin.test.*
fun main() { 
   //sampleStart 
   println("Word".repeat(4)) // WordWordWordWord
println("Word".repeat(0)) // 
   //sampleEnd
}

Throws