java去掉jsp标签内容的方法
//去掉内容的标签
public static String removeTag(String count){
try {
int tagCheck=-1;
do {
int a = count.indexOf("<");
int b = count.indexOf(">");
int len = count.length();
String c=null;
c = count.substring(0, a);
if(b == -1)
b = a;
String d = count.substring((b + 1), len);
count = c + d;
tagCheck = count.indexOf("<");
} while (tagCheck != -1);
} catch (Exception e) {
System.out.println("去掉内容标签异常,可能是该内容没有标签!!!");
}
return count;
}
转载于:https://www.cnblogs.com/qgc88/p/3205119.html