The array to scan.
The value to substitute.
The evaluation predicate, which should return true if the element is a valid match and false if not. This predicate may be any callable type.
The number of elements replaced.
auto array = "abbc".dup; test!("==")(replaceIf(array, 'x', (char c) { return c > 'a'; }), 3); test!("==")(array, "axxx");
auto buffer = createBuffer("abbc"); test!("==")(replaceIf(buffer, 'x', (char c) { return c > 'a'; }), 3); test!("==")(buffer[], "axxx");
Performs a linear scan of the complete array, replacing elements where pred returns true.