replaceAll

fun <T> List<T>.replaceAll(oldValue: T, newValue: T): List<T>

Returns a new list with all occurrences of the specified oldValue replaced by the newValue.

Return

A new list with the replacements made.

Parameters

oldValue

The value to be replaced.

newValue

The value to replace with.