private static string FormatName(string name, int maxLength) { const int capLength = 25; var result = name.PadRight(maxLength); if (result.Length > capLength) result = result.Substring(0, capLength); return result; }