StringEscapeUtils: unescapeHtml(String str) : StringEscapeUtils « org.apache.commons.lang « Java by API






StringEscapeUtils: unescapeHtml(String str)

/*
Escaped HTML >>> <p>MyName<p>
UnEscaped HTML >>> <p>MyName<p>
 
 */
import org.apache.commons.lang.StringEscapeUtils;

public class StringEscapeUtilsTrial {
    public static void main(String[] args) {
        String strHTMLInput = "<p>MyName<p>";
        String strEscapeHTML = StringEscapeUtils.escapeHtml(strHTMLInput);
        String strUnEscapeHTML = StringEscapeUtils.unescapeHtml(strEscapeHTML);
        System.out.println("Escaped HTML >>> " + strEscapeHTML);
        System.out.println("UnEscaped HTML >>> " + strUnEscapeHTML);
    }
}

           
       








Apache-Common-Lang.zip( 248 k)

Related examples in the same category

1.StringEscapeUtils: escapeHtml(String arg0)