/**
* 去除html所有标签返回文字
*/
public static String htmlTagFilter(String inputStr, int len) {
if (inputStr == null || "".equals(inputStr.trim())) {
return "";
}
String outStr = inputStr.replaceAll("\\&[a-zA-Z]{1,10};", "") //去除类似< > 的字串
.replaceAll("<[a-zA-Z]+[1-9]?[^><]*>", "") //去除开始标签及没有结束标签的标签
.replaceAll("</[a-zA-Z]+[1-9]?>", ""); //去除结束标签
if (outStr.length() > len) {
outStr = outStr.substring(0, len);
outStr += "......";
}
return outStr;
}