with

fun with(index: Int, value: T): R(source)

Copies the array and inserts the given number at the provided index.

Parameters

index

The index of the value to overwrite. If the index is negative, then it replaces from the end of the array.

value

The value to insert into the copied array.