Recently, I am working on an Android project. I am parsing data from a wordpress api. But detailed posts are posted in html formet. I need to remove html tags. Using the html.fromHtml () method. ToString () java, I deleted all the tags. But there are some images that I have to delete. To remove the title, I have to find the tag class. So, how can I remove this content using the Html class?
<p class="wp-caption-text">android m marshmallow</
EDIT:
Using regex, I solved my problem.
Paste your Html into Regex and you will get your regular expression.
yourHtml = yourHtml.replaceAll("Your_Regular_Expression",""); yourHtml = Html.fromHtml(yourHtml).toString();
source share