public static String getHTMLWithString(String contentC) {
String content = contentC;
if (content == null) {
return "";
}
content = content.replaceAll("&", "&");
content = content.replaceAll("<", "<");
content = content.replaceAll(">", ">");
content = content.replaceAll(""", "\"");
content = content.replaceAll("\r ", " \n");
content = content.replaceAll(" ", " \n");
content = content.replaceAll(" ", " ");
content = content.replaceAll("'", "'");
content = content.replaceAll("!", "!");
return content;
}
附件是比较全的特殊符号转换。
- HTML特別記号.rar (9.9 KB)
- 下载次数: 0