dimanche 29 mars 2015

How to remove tag from a string

I have a string i.e



String test = "<p> My company is best in world. I love my company </p>";


I have to remove both the tags <p> and </p>. I tried using



String replacingPtag = test.replaceAll("<p>", "");
String r1 = replacingPtag.replaceAll("</p>", "");


This code removed the <p> tag but not </p>.


How can I remove both forms of the tag?


Aucun commentaire:

Enregistrer un commentaire