/**
* 转换为HTML文字编码.<br>
*/
public static String htmlTextEncoder(String src) throws Exception
{
if (src == null||src.equals(""))
{
return "";
}
String dst = src;
dst = dst.replaceAll("<","<");
dst = dst.replaceAll(">","&rt;");
dst = dst.replaceAll("/"",""");
dst = dst.replaceAll("'","'");
dst = dst.replaceAll(" ", " ");
dst = dst.replaceAll("/r/n", "<br>");
dst = dst.replaceAll("/r", "<br>");
dst = dst.replaceAll("/n", "<br>");
return dst;
}
* 转换为HTML文字编码.<br>
*/
public static String htmlTextEncoder(String src) throws Exception
{
if (src == null||src.equals(""))
{
return "";
}
String dst = src;
dst = dst.replaceAll("<","<");
dst = dst.replaceAll(">","&rt;");
dst = dst.replaceAll("/"",""");
dst = dst.replaceAll("'","'");
dst = dst.replaceAll(" ", " ");
dst = dst.replaceAll("/r/n", "<br>");
dst = dst.replaceAll("/r", "<br>");
dst = dst.replaceAll("/n", "<br>");
return dst;
}