private static string Abbreviate(string txt, int length) { if (string.IsNullOrEmpty(txt)) return string.Empty; return txt.Substring(0, Math.Min(length, txt.Length - 1)); }