How to unescape HTML character entities in Java?

前端 未结 11 1748
耶瑟儿~
耶瑟儿~ 2020-11-21 22:38

Basically I would like to decode a given Html document, and replace all special chars, such as \" \" -> \" \", \">\" -

11条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-21 23:23

    The following library can also be used for HTML escaping in Java: unbescape.

    HTML can be unescaped this way:

    final String unescapedText = HtmlEscape.unescapeHtml(escapedText); 
    

提交回复
热议问题