replacement specs, alternating between string to be replaced and toStringNow-able object to replace with.
import std.stdio; void main() { string s = Replace!(q{$ret func(T)(T t){ return new $ret(t+$i); }}, "$ret", "C", "$i", 5000); writeln(s); // "C func(T)(T t){ return new C(t+5000); }" }
If there is ambiguity between two substrings to replace, the longer one is preferred:
enum s = Replace!("boy eats boysenberry", "boy", "girl", "boysenberry", "plum"); writeln(s) // "girl eats plum"
Performs compile time string replacements on base