How to remove content from <style> tags using Html.fromHtml ()?

I need to get "plain text" from html strings. I am using Html.fromHtml which works really well, but I notice that sometimes HTML has tags and although cleans up the tag well, it does not remove the content.

I think this behavior makes sense, but does not suit my needs. Do you know how to remove html inside tags? Do I have additional string handling? (like substrings, regex or so ...).

I've read about TagHandler, but I'm not sure if I could solve my problem, it seems to handle additional tags to avoid removing content for a specific tag.

+3


source to share


1 answer


you can try replacing it with something like



replaceAll(""">([a-Z0-9]*)<""", "")

      

0


source







All Articles