Strip HTML with ASP Question
Hello,
I am trying to strip all the html tags, including as well as all end of line characters so that whats left is all on one line. I have got it working for just the html tags but cant for the life of me get it to clean the or end of line characters. Here's what I have so far. Any suggestions?
Function StripHTMLTag(ByVal sText)
StripHTMLTag = ""
fFound = False
Do While InStr(sText, "<")
fFound = True
StripHTMLTag = StripHTMLTag & " " & Left(sText, InStr(sText, "<")-1)
sText = MID(sText, InStr(sText, ">") + 1)
Loop
Do While InStr(sText, " ")
fFound = True
StripHTMLTag = StripHTMLTag & " " & Left(sText, InStr(sText, " ")-1)
sText = MID(sText, InStr(sText, " ") + 1)
Loop
StripHTMLTag = StripHTMLTag & sText
If Not fFound Then StripHTMLTag = sText
End Function
|