Closed Boscop closed 6 years ago
Good catch. Escaping isn't currently supported. If sticking with $
syntax, I'd say $$
is probably the right choice.
If I switch to {foo}
syntax as mentioned in #2, then I'd probably follow Rust's format string escaping rule:
The literal characters { and } may be included in a string by preceding them with the same character. For example, the { character is escaped with {{ and the } character is escaped with }}.
so s!("{foo}")
displays the variable foo
and s!("{{foo}}")
displays the string "{foo}"
I've added escaping to the 0.2.0 version which using the "{foo}"
syntax and "{{foo}}"
escaping.
I can revisit dollar-sign escaping if I revert to the $foo
syntax.
How to escape the dollar sign in a string like
so that it becomes
"Total: $ 9.99"
?