I have data in this format <b><i>testing </i> </b>
and I need to convert this string into an equivalent java string. Can anyone suggest the process?
Thank you
Asked
Active
Viewed 65 times
-1
-
1Do you want to remove the special character ?? – Kick Jan 28 '14 at 07:46
-
see http://stackoverflow.com/questions/18471500/how-can-i-add-escape-characters-to-a-java-string for escaping quotes – Sergei Chicherin Jan 28 '14 at 07:48
-
no when i enter any data in my application i will save in escape formant that is for < it will save as &ls like that – Nagarjun Jan 28 '14 at 08:43
1 Answers
0
try this :
import static org.apache.commons.lang.StringEscapeUtils.escapeHtml;
// ...
String source = "<b><i>testing </i> </b>";
String escaped = escapeHtml(source);

Salah
- 8,567
- 3
- 26
- 43