Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

HTML stripping?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carlo Razzeto - 10 Jul 2007 22:29 GMT
Any one aware of a good library/function out there which quickly and
reliably can strip out all HTML from a string? We have an ASP.Net page that
needs to be able to scrub out some (rather bad) HTML from a CSV field, most
solutions we've come up with/found only partially work (some times missing
text or throwing out exceptions). I have to say this is the one and only
thing I miss from my PHP days $string = striphtml( $string );

Carlo
Alexey Smirnov - 10 Jul 2007 22:56 GMT
> Any one aware of a good library/function out there which quickly and
> reliably can strip out all HTML from a string? We have an ASP.Net page that
> needs to be able to scrub out some (rather bad) HTML from a CSV field, most
> solutions we've come up with/found only partially work (some times missing
> text or throwing out exceptions). I have to say this is the one and only
> thing I miss from my PHP days $string = striphtml( $string );

Carlo, you can try to use Regex.Replace, for example

string striphtml(string s) {
return Regex.Replace(s, @"<[^>]*>", "");
}

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.