Does anyone have a simple tool that can convert a non-escaped string to an escaped string?
For example, I'm trying to paste the following data into a Java String datatype:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
I manually have to add the slashes:
<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
Then I can paste into my java code:
String xml="<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
Adding the slashes gets very annoying when it's a 3MB string. I know find/replace can work in a lot of tools, but I do this so often that I need an even faster way.
This must be a common issue. What do most developers do? I'm thinking a good Emacs macro could do the trick but I didn't see anything obvious.