I have the following inside of my view
@Html.DisplayFor(modelItem => item.FirstName)
I need to get the first initial of the First Name.
I tried
@Html.DisplayFor(modelItem => item.FirstName).Substring(1,1)
but it does not seem to work. I get the following error: .. 'System.Web.Mvc.MvcHtmlString' does not contain a definition for 'Substring' and no extension
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…