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));
    }/*w w w.  j  a v a  2s  .c o  m*/

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

        return html;
    }
}