There is a great utility for this purpose in Java world : Lang package in apache commons project
Download commons-lang and put the commons-lang-xxx.jar file in your classpath or in your project.
The StringEscapeUtils class is your key class here.
Use static escapeXml() , escapeHtml() , unescapeXml() , unescapeHtml() methods.
String escaped = StringEscapeUtils.escapeXml("
Great & Lifesaving , thanks apache again !

3 comments:
Thanks!
Thanks
Thanks!
Post a Comment