string_literal_replace!() { /* proc-macro */ }Expand description
Replace contents of a string literal at compile-time.
assert_eq!(string_literal_replace!("hello, world!" ("hello" -> "goodbye")), "goodbye, world!");This macro can chain with other macros that output string literals, like concat!:
assert_eq!(
string_literal_replace!(concat!("hello", ", world!") ("hello" -> "goodbye")),
"goodbye, world!"
);