DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Brian has posted 1 posts at DZone. View Full User Profile

Strip XML- Or HTML-like Tags From A String

09.29.2008
| 11663 views |
  • submit to reddit
        // A convenience method that strips XML/HTML tags from string

private String stripTags(String HTMLString) {
    String noHTMLString = HTMLString.replaceAll("\\<.*?>","");
    return noHTMLString;
}