I want to remove the html that is stored in my database for Comments field. Right now I'm able to shorten it less than 16 characters but when it is display on a datatable calling the ShortComments field but the HTML still shows.
<div>Test<spa ...
I have it set up as this in my model class file:
public string Comments { get; set; }
public string ShortComments => Comments?.Length > 14 ? $"
{Description.Substring(0, 13)} ..." : Comments;
How do I fix the above html to strip out the html so it says "Test..." on the view page.
Tried this
<td>@Regex.Replace(dorItem.ShortDescription, @"<[^>]+>| ",
"").Trim()</td>
and it does remove most of html except
<span style>
How can I get rid of that?