How to remove specific html tag from a string in Java

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
        String s = "<p>Java Programming</p>";

        s = s.replaceAll("\\<.*?\\>", "");
        
        System.out.println(s);
    }
}




/*
run:
 
Java Programming
 
*/

 



answered Aug 18, 2021 by avibootz
...