Skip to content

Instantly share code, notes, and snippets.

@Dynyx
Created June 4, 2012 13:19
Show Gist options
  • Save Dynyx/2868324 to your computer and use it in GitHub Desktop.
Save Dynyx/2868324 to your computer and use it in GitHub Desktop.
Remove HTML tags from a string
using System.Text.RegularExpressions;
public string removeHTML(string input)
{
string pattern = @"<(.|\n)*?>";
Regex regex = new Regex(pattern, RegexOptions.Singleline);
string output = regex.Replace(input, string.Empty);
return output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment