RemoveHTMLTags

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

Public
Tested
My Own Work
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("BOB rules")

Views 3726 Downloads 1039

Classic ASP Texts + Strings
DevinGarlit
4
Revisions

v1.0