CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Strip HTML Tags and carriage returns

Print topic Send  topic

Author Message
ChipW
Posted: 01/04/2005, 2:55 PM

I'm needing to create a data feed, but need to get rid of the HTML tags and the carriage returns (not <br>) that are in a column in my DB.

Thanks
Chip
guest
Posted: 01/05/2005, 9:22 PM

Maybe this will help




Function stripHTML(strHTML)
'First grt rid of the <BR> and use vbcrlf instead

Replace(strHTML, "<br>", "VBCRLF")

'Then use rgular expression to remove the rest
'Strips the HTML tags from strHTML

Dim objRegExp, strOutput
Set objRegExp = New Regexp
s
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<(.|\n)+?>"

'Replace all HTML tag matches with the empty string
strOutput = objRegExp.Replace(strHTML, "")

'Replace all < and > with "";
strOutput = Replace(strOutput, "<", "")
strOutput = Replace(strOutput, ">", "")

stripHTML = strOutput 'Return the value of strOutput

Set objRegExp = Nothing
End Function


Regards

Wayne




"ChipW" <ChipW@forum.codecharge> wrote in message
news:641db1ecadec7f@news.codecharge.com...
> I'm needing to create a data feed, but need to get rid of the HTML tags
> and the
> carriage returns (not <br>) that are in a column in my DB.
>
> Thanks
> Chip
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.