Is there a general Scala utility method that converts a string to a string literal? The simple lambda function "\"" + _ + "\""
only works for strings without any special characters.
For example, the string \"
(length 2) should be converted to the string "\\\""
(length 6).
Wrap the String with 3 quotes to represent it as is..
e.g.
val str = """ \" """ // str : java.lang.String = \"
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