replace

replace(index: Integer64;
        value: MemberType) updating;

The replace method of the Array class replaces an existing entry in an array at the position specified by the index parameter with the entry specified in the value parameter.

If the specified index does not exist, an exception is raised.