public static String htmlToString(String src){
String msg = "";
if (isNull(src) || "null".equals(src)) {
return "";
} else {
msg = src.replaceAll("<[^img|^p|^/p].*?>", "");
msg = msg.replaceAll("<\\/[^p].*?>", "");
msg = msg.replaceAll("<p.*?>", "");
msg = msg.replaceAll("<P.*?>", "");
msg = msg.replaceAll("<p>", "");
msg = msg.replaceAll("</p>", "");
return msg;
}
}
public static void main(String args[]) {
System.out.println(htmlToString("<p>D</p>"));
}
String msg = "";
if (isNull(src) || "null".equals(src)) {
return "";
} else {
msg = src.replaceAll("<[^img|^p|^/p].*?>", "");
msg = msg.replaceAll("<\\/[^p].*?>", "");
msg = msg.replaceAll("<p.*?>", "");
msg = msg.replaceAll("<P.*?>", "");
msg = msg.replaceAll("<p>", "");
msg = msg.replaceAll("</p>", "");
return msg;
}
}
public static void main(String args[]) {
System.out.println(htmlToString("<p>D</p>"));
}