日期:2014-05-17 浏览次数:20575 次
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; } public static String getStringWithHTML(String contentC) { String content = contentC; if (content == null) { return ""; } content = content.replaceAll("&", "&"); content = content.replaceAll("<", "<"); content = content.replaceAll(">", ">"); content = content.replaceAll("\"", """); content = content.replaceAll("\n\r", " "); content = content.replaceAll("\r\n", " "); content = content.replaceAll("\n", " "); content = content.replaceAll(" ", " "); content = content.replaceAll("'", "'"); content = content.replaceAll("!", "!"); return content; }