How to

strip html tags

Published: 15. January 2009 | Updated: 15. January 2009
License: Microsoft Public License (MS-PL)
Categories: Network
Tags: C# Network Webforms
Was this snippet helpful for you? YESYES / NONO

Import namespace

using System.Text.RegularExpressions;

Code

string page = "<html><head><title>My Title</title></head><body>Text</body></html>";
string text = Regex.Replace(page, "<[^>]*>", String.Empty);
Send us feedback about this snippet »



Related Snippets: