replacedAt

fun <T> List<T>.replacedAt(index: Int, element: T): List<T>

Returns a copy of this list with the element at index replaced by element.

Throws

if index is not a valid index.