<%
Option Explicit
Function stripHTML (strtext)
Dim arysplit, I, j, strOutput
Arysplit = split (strtext, "<")
If len (arysplit (0)> 0 then j = 1 else j = 0
For I = j to ubound (arysplit)
If instr (arysplit (I), ">") then
Arysplit (I) = mid (arysplit (I), instr (arysplit (I), ">") + 1)
Else
Arysplit (I) = "<" & arysplit (I)
End if
Next
StrOutput = join (arysplit ,"")
StrOutput = mid (strOutput, 2-j)
StrOutput = replace (strOutput, ">", "> ")
StrOutput = replace (strOutput, "<", "<")
StripHTML = strOutput
End Function
%>
<Form method = "post" id = form1 name = form1>
<B> Enter an HTML String: </B> <br>
<Textarea name = "txtHTML" cols = "50" rows = "8" wrap = "virtual"> <% = Request ("txtHTML") %> </textarea>
<P>
<Input type = "submit" value = "Strip HTML Tags! "Id = submit1 name = submit1>
</Form>
<% If Len (Request ("txtHTML")> 0 then %>
<P> <B> <u> View of string <I> with no </I> HTML stripping: </u> </B> <br>
<Xmp>
<% = Request ("txtHTML") %>
</Xmp> <p>
<B> <u> View of string <I> with </I> HTML stripping: </u> </B> <br>
<Pre>
<% = StripHTML (Request ("txtHTML") %>
</Pre>
<% End If %>