using Hotline.Settings; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Hotline.Tools { public class LogTool { /// /// 截取指定长度的字符串 /// /// /// /// /// public static string GetSubString(string value, int length, bool ellipsis = false) { if (string.IsNullOrEmpty(value)) { return value; } if (value.Length > length) { value = value.Substring(0, length); if (ellipsis) { value += "..."; } } return value; } } }