Fix 9 design majors: ITrackService interface, IsDescending, ArrayPool base, CliUtils, sort sentinel cleanup, content controller via TrackService, Skip property
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
namespace DeepDrftCli.Utils;
|
||||
|
||||
internal static class CliUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// Truncates a string to fit within the specified column width,
|
||||
/// appending "..." when the string is longer.
|
||||
/// </summary>
|
||||
internal static string TruncateString(string input, int maxLength)
|
||||
{
|
||||
if (string.IsNullOrEmpty(input))
|
||||
return string.Empty;
|
||||
|
||||
return input.Length <= maxLength ? input : input.Substring(0, maxLength - 3) + "...";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user