Snippets

Remove html tags from a string

Java

String html_stripped = html.replaceAll("\\<.*?\\>", "");

PHP

strip_tags($html);  
// built-in PHP function to strip HTML and PHP tags

Javascript

var html_stripped = html.replace(/(<.*?>)/ig,"");

Are you a developer? Want to get a promotion, work on interesting projects, land a high paying job at a tech company or stand out from the crowd?

Then this ebook is for you!

Career Guide for Software Developers

Career Guide for Software Developers

3 thoughts on “Remove html tags from a string

  1. Great Work ! Short And Sweet Keep Going

  2. Thanks for this – very nice little piece of code and very muchly appreciated!

Comments are closed.

Twitter
LinkedIn
YouTube
Instagram