I have a formatted XML file, and I want to convert it to one line string, how can I do that.
Sample xml:
// 1. Read xml from file to StringBuilder (StringBuffer)
// 2. call s = stringBuffer.toString()
// 3. remove all "\n" and "\t":
s.replaceAll("\n","");
s.replaceAll("\t","");
edited:
I made a small mistake, it is better to use StringBuilder in your case (I suppose you don't need thread-safe StringBuffer)