Im currently using a truncate and texteditor in different way. And both is working fine but I facing this problem. I want to truncate a text inside the texteditor. T_T
Im using truncate this way and its working
@helper Truncate(string input, int length)
{
if (input.Length <= length)
{
@input
}
else
{
@input.Substring(0, length)<text>...</text>
}
}
@foreach (var item in Model)
{
<div>
@Truncate(item.DetailDescription, 400)
</div>
}
AND
Im declaring raw to call a texteditor this way and its also working fine
@html.Raw(item.DetailDescription)
PROBLEM: How could I possibly combine the two in a single function? Is this even possible T_T