I have the following Java code:
str = str.replaceAll(\"<.*?>.*?|<.*?/>\", \"\");
This turns a String like so:
You can try this too:
str = str.replaceAll("<.*?>", "");
Please have a look at the below example for better understanding:
public class StringUtils {
public static void main(String[] args) {
System.out.println(StringUtils.replaceAll("How now brown cow."));
System.out.println(StringUtils.replaceAll("How now brown cow."));
}
public static String replaceAll(String strInput) {
return strInput.replaceAll("<.*?>", "");
}
}
Output:
How now brown cow.
How now brown cow.