Tolgar
asked on
How to resolve Invalid escape sequence in Java?
How can I use back slashes for a string in Java?
For example:
It underlines the whole string in read it says:
I solved the problem by doing the following but I am looking for a more elegant solution:
For example:
myString = "run -u A \\msomething\hsomething\something\something done";
It underlines the whole string in read it says:
Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\ )
I solved the problem by doing the following but I am looking for a more elegant solution:
myString = "run -u A" + "\\\\" + "msomething" + "\\" + "hsomething" + "\\" + "something" + "\\" + "something done";
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.