Skip to content

Instantly share code, notes, and snippets.

@Godoy
Last active August 29, 2015 13:58
Show Gist options
  • Save Godoy/10418393 to your computer and use it in GitHub Desktop.
Save Godoy/10418393 to your computer and use it in GitHub Desktop.
remover tags html de uma string com regex expressão regular
var body = Regex.Replace(HttpUtility.HtmlDecode(item.Body), "<.*?>", string.Empty);
var size = body.Length <= 200 ? body.Length - 1 : 200;
<p>@Html.Raw(body.Substring(0, size))...</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment