Kudu.Core.StringExtensions.Truncate C# (CSharp) Method

Truncate() public static method

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