HtmlHelper to display only a few characters

115 views Asked by At

Is it possible use a HtmlHelper to display only a few characters of the text? how can I do this?

1

There are 1 answers

0
mxmissile On BEST ANSWER

Something like this?

public static MvcHtmlString SubString(this HtmlHelper helper, string theString, int length)
{
  return MvcHtmlString.Create(theString.Substring(0,length));
}