IFormatProvider and IFormattable


The IFormatProvider interface defines one method called GetFormat( ), which returns an object that controls the formatting of data into a human-readable string. The general form of GetFormat( ) is shown here:

 object GetFormat(Type fmt)

Here, fmt specifies the format object to obtain.

The IFormattable interface supports the formatting of human-readable output. IFormattable defines this method:

 string ToString(string fmt, IFormatProvider fmtpvdr)

Here, fmt specifies formatting instructions and fmtpvdr specifies the format provider.

Note 

Formatting is described in detail in Chapter 21.




C# 2.0(c) The Complete Reference
C# 2.0: The Complete Reference (Complete Reference Series)
ISBN: 0072262095
EAN: 2147483647
Year: 2006
Pages: 300

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net