Question above.
And by 'unescaped' I mean "Hello \\n \\\"World\\\"".
String myString = "Hello \\n \\\"World\\\"";
System.out.println("Before : \n");
System.out.println(myString);
String myConverted = escape(myString);
System.out.println("After : \n");
System.out.println(myConverted);
Output:
Before :
Hello \n \"World\"
After :
Hello
"World"
So I would be converting it to "Hello \n \"World\"".
I want it to escape the characters.
Is there a function to do this? escape is only an example.
String myConverted = myString.translateEscapes();- documentation (which can be searched)