Here you can find the source of replaceHtml(String html)
public static String replaceHtml(String html)
//package com.java2s; //License from project: Apache License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static String replaceHtml(String html) { if (isBlank(html)) { return ""; }/*from w w w . jav a2 s .c o m*/ String regEx = "<.+?>"; Pattern p = Pattern.compile(regEx); Matcher m = p.matcher(html); String s = m.replaceAll(""); return s; } public static boolean isBlank(String str) { return (isEmpty(str) || (str.trim().length() == 0)); } public static boolean isEmpty(String str) { return (str == null || str.length() == 0); } }