/// <summary> /// 截断字符串 /// </summary> /// <param name="s">源字符串</param> /// <param name="length">需要截断的长度</param> /// <param name="isend">是否添加...标记</param> /// <returns></returns> public static string GetSubString(string s, int length, bool isend) { if (!string.IsNullOrEmpty(s) && length > 0) { if (isend) { return(StrHelper.GetUnicodeSubString(s, length, "...")); } else { return(StrHelper.GetUnicodeSubString(s, length, "")); } } return(s); }