title: How can I escape special symbols in scala string?
body: <p>Is there a general Scala utility method that converts a string to a string literal? The simple lambda function <code>"\"" + _ + "\""</code> only works for strings without any special characters.</p>
  
  <p>For example, the string <code>\"</code> (length 2) should be converted to the string <code>"\\\""</code> (length 6).</p>