Monday, April 14, 2008

Remove HTML Tags from string in ASP Classic

function removeHtmlChar(strText)
    l=len(strText)
          for i=1 to l
              ch=mid(strText,i,1)             
x=i             
if(ch="<")then                  
x=i                 
do while(mid(strText,x,1)<>">")
                       
x=x+1 
                  
loop
                  
t=t & " "
             elseif
(ch="&") then
                  
x=i                  do While(mid(strText,x,1)<>";")                       
x=x+1                   loop
                 
t=t & " "             else
                 
t=t &ch              end
if
    i=x
    next
    strText=t
end function