the base of the new array
the slice of s to be replaced
the items to replace slice with
A new array that is s with slice replaced by replacement[].
auto a = [1, 2, 3, 4, 5]; auto b = replaceSlice(a, a[1 .. 4], [0, 0, 0]); assert(b == [1, 0, 0, 0, 5]);
std.algorithm.iteration.substitute for a lazy replace.
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.