In Javascript, we can use the ES6 raw string String.raw`raw text`
to form a raw string, but it uses the template string syntax at the same time.
If I want to store the string "${a}\${b}, with \n"
, I cannot use something such as String.raw`${a}\${b}, with n`
or String.raw"${a}${b}, with n"
(of course, the tag function is not used this way).
Is there a prettier way to write it, similar to writing r"{a}{b}, with n"
(no $ in Python format syntax) in Python?
Tastror is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.