public static String htmlToStr(String htmlStr){ String result = ""; boolean flag = true; if(htmlStr==null){ return null; } htmlStr = htmlStr.replace("\"", ""); //去掉引号 char[] a = htmlStr.toCharArray(); int length=a.length; for(int i=0;i<length;i++){ if(a[i]=='<'){ flag=false; continue; } if(a[i]=='>'){ flag=true; continue; } if(flag==true){ result+=a[i]; } } return result.toString(); }
更多java去掉html標籤 必須先去掉雙引號的正規相關文章請追蹤PHP中文網!