RemoveHTMLTags

Remove HTML tags from a string, note, this won't handle html encoding.

Function RemoveHTMLTags(strString)
 Dim nCharPos, sOut, bInTag, sChar
 sOut = ""
 bInTag = False
 For nCharPos = 1 To Len(strString)
  sChar = Mid(strString, nCharPos, 1)
  if sChar = "<" Then
   bInTag = True
  End if
  if Not bInTag Then sOut = sOut & sChar
  if sChar = ">" Then
   bInTag = False
  End if
 Next
 RemoveHTMLTags = sOut
End Function

strString

write RemoveHTMLTags(&#34;<B>BOB</B> rules&#34;)

Views 499 Downloads 152

'Replace', 'HTML', 'Tags', 'Convert', 'Encoding', 'Substitute', 'Change'

DevinGarlit
4
Texts + Strings Classic ASP
Revisions

v1.0