Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove all html tags within a string

Status
Not open for further replies.

dstrange

Programmer
Nov 15, 2006
87
CA
Does anyone have a vb function that will remove all html tages within a large string of data? I've tried some of the functions below but to no avail yet. Any help would be appreciated.

Code:
    Function RemoveHTML(ByVal strText As String) As String
        strText = System.Text.RegularExpressions.Regex.Replace(strText, "<(/?[^\>]+)>", "")        
        strText = strText.Replace("<", "")
        Return strText
    End Function
 
Just leaving a note of what worked for me in case anyone else has a similar situation:

Code:
Dim strText As String
strText = System.Text.RegularExpressions.Regex.Replace(strText, "<(/?[^\>]+)>", "")
strText = strText.Replace("<", "")
 
hmmm you're right. Oh well I'm just riding the clock here at work....

Have a great weekend!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top