BinaryStudio.ClientManager.DomainModel.Infrastructure.StringExtensions.Cut C# (CSharp) Method

Cut() public static method

If string is more then maximum length then it will be cutten for maximum length and last 3 symbols will be changed for "..." string s="This is string"; var result=s.Cut(7); //result will be equal "This..."
public static Cut ( this line, int maxLength ) : string
line this
maxLength int Maximum length of string
return string
        public static string Cut(this string line, int maxLength)
        {
            return line.SafeGet(x => x.Length) > maxLength ? line.Substring(0, maxLength - 3) + "..." : line;
        }