Replace the string containing "with"?
6 answers
Each forward slash must be escaped as part of a string. So if you want a string to look like "\\"
, your code must contain String s = "\\\\"
. Terrible but true.
The same applies to any other special character that can be interpreted. Quotes and colons inclusive. This means it " \ " "
will look like " \\ \" "
(Added spaces to make individual screens more visible)
+1
source to share