replace

fun replace(i: Int, new: T)(source)
fun replace(old: T, new: T): Boolean(source)