HTML stripping?

C

Carlo Razzeto

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
 
G

Guest

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, @"<[^>]*>", "");
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top