Yeah, just tried it, copy the below into a plain text file...
'Start
MsgBox stripHTML("<p><b><font face=""arial"">The number 3 is > number
2.</b></p>")
function stripHTML(strtext)
stripHTML=""
if len(strtext)=0 then Exit Function
dim arysplit,i,j
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
stripHTML=replace(replace(mid(join(arysplit),2-j),">",">"),"<",">")
end function
'End
... taking care of any line wrapping...
... change the file extension to .vbs and then just double click it.
You will get an Alert box with just "The number 3 is > number 2."
try it.
Nick
:> -----Original Message-----
:> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
:> Sent: 09 October 2002 00:17
:> To: ActiveServerPages
:> Subject: RE: Removing all HTML tags
:>
:>
:> Thanks Nick. One question........
:>
:> Does this work is a "<" or ">" is part of the string such as:
:>
:> <p><b><font face="arial">The number 3 is > number 2.</b></p>
:>
:>
:>
:> Quoting Nick Middleweek <[EMAIL PROTECTED]>:
:>
:> > Well, forgot my advice, looks like Lon has a better idea! You
:> know I keep
:> > forgetting the power of split and join.
:> >
:> > Cheers,
:> > Nick
:> >
:> >
:> > :> -----Original Message-----
:> > :> function stripHTML(strtext)
:> > :> stripHTML=""
:> > :> if len(strtext)=0 then Exit Function
:> > :> dim arysplit,i,j
:> > :> 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
:> > :>
:> stripHTML=replace(replace(mid(join(arysplit),2-j),">",">"),"<","<"
:> > :> )
:> > :> end function
:> >
:> >
:> > ---
:> > You are currently subscribed to activeserverpages as:
:> > [EMAIL PROTECTED]
:> > To unsubscribe send a blank email to
:> > %%email.unsub%%
:> >
:>
:>
:>
:>
:>
:> ---
:> You are currently subscribed to activeserverpages as:
:> [EMAIL PROTECTED]
:> To unsubscribe send a blank email to
:> %%email.unsub%%
:>
---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]