kotlin.text.replaceRange

replaceRange

fun CharSequence.replaceRange(
    startIndex: Int, 
    endIndex: Int, 
    replacement: CharSequence
): CharSequence

Returns a char sequence with content of this char sequence where its part at the given range is replaced with the replacement char sequence.

Parameters

startIndex - the index of the first character to be replaced.

endIndex - the index of the first character after the replacement