Last active
August 29, 2015 13:58
-
-
Save Godoy/10418393 to your computer and use it in GitHub Desktop.
remover tags html de uma string com regex expressão regular
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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