lubelog/Helper/StaticHelper.cs
2024-01-13 11:48:20 -07:00

28 lines
803 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 GenericErrorMessage = "An error occurred, please try again later";
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;
}
}
}
}