This is probably something so easy, but I am having a hard time finding the right syntax. Basically I am using substring to cut a line short then I just want to add a “…” on the end. I just cant seem to find the right way to do it.
@if (@Model.Name.Length > 20)
{
@Model.Name.Substring(0, 20) //"..." goes here
}
else
{
@Model.Name
}
Or even: