Remove HTML tags

Report a typo

For a given string you should remove all HTML tags from it. An HTML tag starts with the symbol "<" and ends with the symbol ">".

You should output the string without HTML tags.

Sample Input 1:

<h1>Simple header</h1>

Sample Output 1:

Simple header

Sample Input 2:

<h2>Header with <b>bold</b> text</h2>

Sample Output 2:

Header with bold text
Write a program in Java 17
import java.util.Scanner;

public class Main {

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String stringWithHtmlTags = scanner.nextLine();

// write your code here
}
}
___

Create a free account to access the full topic