C# Class TextHelper.Truncator

Afficher le fichier Open project: tylermercier/TextHelper

Méthodes publiques

Méthode Description
Truncate ( this text, int maxLength = 30, string ommision = "...", string separator = "" ) : string

Truncates a given text after a given length.

Private Methods

Méthode Description
ApplySeparator ( string text, string separator ) : string

Method Details

Truncate() public static méthode

Truncates a given text after a given length.
public static Truncate ( this text, int maxLength = 30, string ommision = "...", string separator = "" ) : string
text this
maxLength int Length of truncated text (default is 30)
ommision string The last characters to be replaced with if truncated. (defaults to "...").
separator string Include if you want to truncate text at a natural break. For example, " " will truncate at word boundaries
Résultat string