I'm following a tutorial on MVC on the .NET 4 framework. The tutorial created a function like this...
using System.Web;
using System.Web.Mvc;
namespace vohministries.Helpers
{
public static class HtmlHelpers
{
public static string Truncate(this HtmlHelper helper, string input, int length)
{
if (input.Length <= length)
{
return input;
}
else
{
return input.Substring(0, length) + "...";
}
}
}
}
I have no idea whatthis HtmlHelper helper
means or represents in the function argument. Is this something new in .NET 4? I think it may be extending the HtmlHelper class but I'm not sure...Could someone explain the syntax?