Java HTML Unescape unescapeHTML(String html)

Here you can find the source of unescapeHTML(String html)

Description

Given escaped html characters, unescapes them.

License

Open Source License

Parameter

Parameter Description
html a parameter

Declaration

public static String unescapeHTML(String html) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/* www. j  av a 2 s. c o  m*/
     * Given escaped html characters, unescapes them. For instance, turning
     * < into <
     * <!-- for those reading the javadoc directly in code, that's: -->
     * <!-- &lt; into < -->
     * @param html
     * @return 
     */
    public static String unescapeHTML(String html) {
        return html.replace("&apos;", "'").replace("&quot;", "\"").replace("&gt;", ">").replace("&lt;", "<")
                .replace("&amp;", "&");
    }
}

Related

  1. htmlUnescape(String s)
  2. htmlUnescape(String source)
  3. unEscapeHTML(final String escapedHTML)
  4. unescapeHtml(final String input)
  5. unescapeHTML(String comment)
  6. unescapeHtml(String s)
  7. unescapeHtml(String s)
  8. unescapeHTML(String s)
  9. unescapeHTML(String s)