Replace all escape sequences with non-escaped equivalent strings in java?

Here is a non-regex solution. String original = "something"; String escapes = new String{""}; // add more if you need String replace = new String{""}; // add more if you need String new = original; for (int I = 0; I ReplaceAll(escapesi, replacei); } Sometimes a simple loop is easier to read, understand, and code.

From a comment of Tomalak: 'And some people, when confronted with regular expressions, think "I know, I'll use a catchy quote that I remember". Now they have added nothing to the discussion. ' (I'm not implying you didn't contribute with your answer, I'm just commenting about the quote which everyone here has seen posted at least 1000000000 times by now...) – Bart Kiers Jun 10 '10 at 13:41 @Bart, I think it's funny.

– jjnguy Jun 10 '10 at 13:43 me too... the first 999999999 times, that is. :) – Bart Kiers Jun 10 '10 at 13:46 D'oh! I learned that long ago... thanks for a straightforward solution.

– Mark Jun 10 '10 at 13:59 @Mark, no problem. Happy to help – jjnguy Jun 10 '10 at 14:09.

StringEscapeUtils.unescapeXml() from commons-lang might be the thing you are looking for.

Works! Best answer – Mark Jun 10 '10 at 14:47.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions


Thank You!
send