W3cubDocs

/Kotlin

setRange

Platform and version requirements: JS (1.4), Native (1.4)
fun StringBuilder.setRange(
    startIndex: Int, 
    endIndex: Int, 
    value: String
): StringBuilder

Replaces characters in the specified range of this string builder with characters in the specified string value and returns this instance.

Parameters

startIndex - the beginning (inclusive) of the range to replace.

endIndex - the end (exclusive) of the range to replace.

value - the string to replace with.

Exceptions

IndexOutOfBoundsException - or IllegalArgumentException if startIndex is less than zero, greater than the length of this string builder, or startIndex > endIndex.

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/set-range.html