C# Class BinaryStudio.ClientManager.DomainModel.Infrastructure.StringExtensions

Afficher le fichier Open project: titarenko/ClientManager

Méthodes publiques

Méthode Description
Cut ( this line, int maxLength ) : string

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..."

Fill ( this format ) : string

Fill string if it is a format string with current arguments.

IsNullOrEmpty ( this line ) : bool

Check if string is empty, or is null or is only spaces in it.

Or ( this line, string defaultValue ) : string

Check if string is empty, or null or only spaces in it then return default value. Otherwise return current string.

Method Details

Cut() public static méthode

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
Résultat string

Fill() public static méthode

Fill string if it is a format string with current arguments.
public static Fill ( this format ) : string
format this
Résultat string

IsNullOrEmpty() public static méthode

Check if string is empty, or is null or is only spaces in it.
public static IsNullOrEmpty ( this line ) : bool
line this
Résultat bool

Or() public static méthode

Check if string is empty, or null or only spaces in it then return default value. Otherwise return current string.
public static Or ( this line, string defaultValue ) : string
line this
defaultValue string Default value
Résultat string