Remove HTML tags
RegEx can be a bit complex, but it sure can do a lot with just a few params. This function will strip all html tags in a string and return the enclosed data. | is the default delimiter.
Public Shared Function RemoveHTMLTags( _
ByVal strText As String, _
Optional ByVal strDelimiter As String = "|") _
As String
Return Regex.Replace(strText, "<(.|\n)+?>", strDelimiter)
End Function
strData = RemoveHTMLTags("<td>1</td><td>2</td><td>3</td>")
strData equals "1|2|3"
- Download this code: RemoveHTMLTags.txt
Trackback URI |