namespace Valg.EVA.Skanning.Diagnostics
{
    public static class StringExtensions
    {
        public static string NotNull(this string toCheck)
        {
            return toCheck ?? string.Empty;
        }

        public static string Truncate(this string value, int maxLength)
        {
            if (string.IsNullOrEmpty(value)) return value;
            return value.Length <= maxLength ? value : value.Substring(0, maxLength);
        }
    }
}
