Padding Padding
Janet
Systems
 Register  Login 
Telephone  01628 566 178
Website Design, Hosting and Software Services
  Search 
Padding
corner Padding corner
Padding Padding
corner Padding corner
 ASP Articles

A short function which may be used to strip HTML tags from a string.

Function StripHTMLTags(ByVal sHTML)
    Dim objRegExp
    Dim sOutput
    sHTML = Trim(sHTML & "")
    If Len(sHTML) > 0 Then
        Set objRegExp = New RegExp
        With objRegExp
             .IgnoreCase = True
             .Global = True
             .Pattern= "<[^>]+>"
             sOutput = .Replace(sHTML, "")
        End With
        Set objRegExp = Nothing
        sOutput = Server.HTMLEncode(sOutput)
        StripHTMLTags = sOutput
    Else
        StripHTMLTags = ""
    End If
End Function

The function should be called as follows

strValue = StripHTMLTags(strString)


This article viewed: 1626 times Back

Copyright © 2004-2007 Janet Systems Ltd.

 Print   

DotNetNuke Website design and hosting from £15.00 per month. More...

Looking for a website design company in the Thames Valley, call us on 01628 566178

DotNetNuke Modules
DotNetNuke Modules availalble from Janet Systems

DotNetNuke Skins
DotNetNukeSkins.gif

from Janet Systems

Padding
Copyright 2002-2008 Janet Systems Ltd.   Terms Of Use  Privacy Statement Tuesday, May 13, 2008