Skip to content

Instantly share code, notes, and snippets.

@AmitKB
Created October 9, 2012 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AmitKB/3857900 to your computer and use it in GitHub Desktop.
Save AmitKB/3857900 to your computer and use it in GitHub Desktop.
// Converts the html text to plain text
public static string RemoveHtmlStuffs(string htmlText)
{
var rx = new Regex(@"<(.|\n)*?>");
return SPEncode.HtmlDecode( // remove characters like &nbsp;, &amp; etc
rx.Replace(htmlText, string.Empty) // remove html tags lik <p>,<div> etc
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment