I'm getting a string from a list of items, The string is currently displayed as "item.ItemDescription" (the 9th row below)
I want to strip out all html from this string. And set a character limit of 250 after the html is stripped. Is there a simple way of doing this? I saw there was a posts saying to install HTML Agility Pack but I was looking for something simpler.
EDIT:
It does not always contain html, If the client wanted to add a Bold or italic tag to an items name in the description it would show up as <"strong">Item Name<"/strong"> for instance, I want to strip out all html no matter what is entered.
<tbody>
@foreach (var itemin Model.itemList)
{
<tr id="@("__filterItem_" + item.EntityId + "_" + item.EntityTypeId)">
<td>
@Html.ActionLink(item.ItemName, "Details", "Item", new { id = item.EntityId }, null)
</td>
<td>
item.ItemDescription
</td>
<td>
@if (Model.IsOwner)
{
<a class="btnDelete" title="Delete" itemid="@(item.EntityId)" entitytype="@item.EntityTypeId" filterid="@Model.Id">Delete</a>
}
</td>
</tr>
}
</tbody>
ItemName
$15.00
– Veda99817 Dec 30 '15 at 22:22