Count the number of HTML tags in a file. An HTML tag is a string enclosed in angle brackets < and >. The tag's name may contain any symbol except the > character to represent the HTML tags for the sake of simplicity.
Scala Regex
I am frontend
Report a typo
Sample Input 1:
<html> <head> <title>Example HTML Page</title> </head> <body> <h1>Example HTML Page</h1> <p>This is an example HTML page.</p> <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> </body> </html>Sample Output 1:
20Write a program in Scala 3
def countTags(html: String): Int =
??? // Write your code here
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.