set

Sets the character at the specified index to the specified value.

expect operator fun StringBuilder.set(index: Int, value: Char)(source)
val sb = StringBuilder("hello")
sb[1] = 'a'   // modifies the character at index 1
println(sb)   // prints: hallo

Source