c#完美截断字符串代码(中文+非中文)
实现代码如下: public static string Truncation(this HtmlHelper htmlHelper, string str, int len) { if (str == null || str.Length == 0 || len 128) { len--; }
实现代码如下: public static string Truncation(this HtmlHelper htmlHelper, string str, int len) { if (str == null || str.Length == 0 || len 128) { len--; }