Java - Write code to strip Html Special Chars

Requirements

Write code to strip Html Special Chars

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String html = "<b>ook2s.com";
        System.out.println(stripHtmlSpecialChars(html));
    }/*from   w  w  w  .  j  a  va 2  s  . co  m*/

    public static String stripHtmlSpecialChars(String html) {
        if (html == null)
            return null;
        html = html.replaceAll("</?[^>]+>", "");
        html = html.replace("&nbsp;", " ");

        return html;
    }
}