I have a text like "$ $abc $$abc ${a} ${}"
. I would like to completely disable string interpolation for the string and not to escape each and individual $
from the string. What should I do? In Scala you declare a string where interpolation is enabled with s"$ $abc $$abc ${a} ${}"
while the normal string is not interpolated.
String interpolation is available for both regular and raw strings ("""
). So you need to escape them, which is easier in a regular String
obviously (see here).
"$ \$abc \$\$abc \${a} \${}"
I'm sorry but there's no other way I'm afraid.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With