/** * 过滤html标签 * @param strHtml * @return */ public static String StripHT(String strHtml) { if(StringUtils.isNotEmpty(strHtml)){ String txt = strHtml.replaceAll("</?[^>]+>", ""); //剔出<html>的标签 txt = txtcontent.replaceAll("<a>\\s*|\t|\r|\n</a>", "");//去除字符串中的空格,回车,换行符,制表符 return txt; }else{ return ""; } }
String 字符串中过滤html标签
最新推荐文章于 2024-05-14 20:56:52 发布