版本根据需要自己选
案例org.apache.commons commons-lang3 3.5
public static void main(String[] args) {
System.out.println(StringEscapeUtils.unescapeHtml4("<p>上你号</p>"));
System.out.println(StringEscapeUtils.escapeHtml4("上你 号
"));
System.out.println(StringEscapeUtils.unescapeHtml4("上你 号
"));
}
输出结果
上你号
<p>上你 号</p>
上你 号
反转义 unescapeHtml4
转义 escapeHtml4


