replaceSlice

fninout(T)[] replaceSlice(T)(inout(T)[] s, in T[] slice, in T[] replacement)

Creates a new array such that the items in slice are replaced with the items in replacement. slice and replacement do not need to be the same length. The result will grow or shrink based on the items given.

Parameters

sthe base of the new array
slicethe slice of s to be replaced
replacementthe items to replace slice with

Returns

A new array that is s with slice replaced by

replacement[].

See Also

substitute for a lazy replace.