有什么方法可以在包含我不想转义的html标签的字符串中转义Java字符吗?例如在字符串中我有
<h1>a b c d ö</h1>
我需要得到:
<h1>a b c d ö</h1>
最佳答案
参见:
public static void main(String[] args) {
String s = "a b c d ö";
System.out.println(StringEscapeUtils.escapeHtml4(s));
}
关于java - 字符串中的转义字符排除 html 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29968194/