The array to scan.
The pattern to match.
The value to substitute.
The evaluation predicate, which should return true if e1 is equal to e2 and false if not. This predicate may be any callable type.
The number of elements replaced.
auto buffer = createBuffer("abbbbc"); test!("==")(replace(buffer, 'b', 'x'), 4); test!("==")(buffer[], "axxxxc");
auto array = "abbbbc".dup; test!("==")(replace(array, 'b', 'x'), 4); test!("==")(array, "axxxxc");
Performs a linear scan of complete array, replacing occurrences of specified element with the new element. Comparisons will be performed using the supplied predicate or '==' if none is supplied.