lubelog/Helper/StaticHelper.cs
DESKTOP-GENO133\IvanPlex d5aee08f69 added truncating function.
2024-01-09 22:15:53 -07:00

27 lines
707 B
C#

namespace CarCareTracker.Helper
{
/// <summary>
/// helper method for static vars
/// </summary>
public static class StaticHelper
{
public static string DbName = "data/cartracker.db";
public static string UserConfigPath = "config/userConfig.json";
public static string TruncateStrings(string input, int maxLength = 25)
{
if (string.IsNullOrWhiteSpace(input))
{
return string.Empty;
}
if (input.Length > maxLength)
{
return (input.Substring(0, maxLength) + "...");
} else
{
return input;
}
}
}
}