/** * 功能描述:在页面上直接显示文本内容,替换小于号,空格,回车,TAB * * @param str * String 原始字符串 * @return String 替换后的字符串 */ public static String htmlshow(String str) { if (str == null) { return null; } str = replace("<", "<", str); str = replace(" ", " ", str); str = replace("\r\n", _BR, str); str = replace("\n", _BR, str); str = replace("\t", " ", str); return str; }