C# Class Appccelerate.Formatters.StringTruncationFormatter

Allows to define the maximal length of an string. A string longer than the given value will be truncated. Use: Format("{0,-5:L5}", "123456") -> "12345" Use: Format("{0,5:L5}", "123") -> " 123" Use: Format("{0,-5:L10}", "1234567890123") -> "1234567890"
Inheritance: IFormatProvider, ICustomFormatter
Show file Open project: appccelerate/appccelerate

Public Methods

Method Description
Format ( string format, object arg, IFormatProvider formatProvider ) : string

After String.Format gets the ICustomFormatter, it calls this format method on each argument.

GetFormat ( Type formatType ) : object

String.Format calls this method to get an instance of an ICustomFormatter to handle the formatting.

Method Details

Format() public method

After String.Format gets the ICustomFormatter, it calls this format method on each argument.
public Format ( string format, object arg, IFormatProvider formatProvider ) : string
format string The format string.
arg object The arguments for the format string.
formatProvider IFormatProvider The formatProvider.
return string

GetFormat() public method

String.Format calls this method to get an instance of an ICustomFormatter to handle the formatting.
public GetFormat ( Type formatType ) : object
formatType System.Type The requested formatType.
return object