Strip HTML Tags From a String





8
Date Submitted Wed. Oct. 12th, 2005 9:50 PM
Revision 1 of 1
Helper ses5909
Tags CSharp | HTML | String | Strip
Comments 0 comments
Strip HTML Tags From a String
string strippedString = Regex.Replace(htmlString,@"<(.|\n)*?>",string.Empty);

//this will strip anything found in HTML tags.
//(.|\n) -- Finds any character including the new line character
// *?  -- 0 or more occurences and the match will stop at the first occuring ">" it sees
 

Sara Smith

www.ilovecode.com
Sara

ilovecode

Comments

There are currently no comments for this snippet.

Voting