我想创建一个省略号,当字符串长度超过200时,它会显示......当点击它时,会显示剩余的文本。 我能够显示省略号...,但我遇到的问题是:
这是功能
public static string DisplayText(this string str, int charallowed)
{
if (str.Length > charallowed)
return str.Substring(0, charallowed) + " ....";
return str;
}
查看
@Html.Raw(@BPP.CCSP.Admin.Web.Helpers.ClipText.DisplayText(item.OPTION_VALUE, 200))
这是我目前的结果
请问我该怎么做。