stripTags

strip tags from an HTML string

string
stripTags
(
string input
,
in string[] allowedTags = []
)

Parameters

input string

the HTML string you want to strip tags from

allowedTags string[]

an array of tag names allow in final output

Examples

assert(stripTags("<html><b>bold</b></html>") == "bold");
assert(stripTags("<html><b>bold</b></html>", ["<html>"]) == "<html>bold</html>");

Meta