StringBuilderAppendFormat Method (IFormatProvider, String, Object) |
Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of a corresponding argument in a parameter array using a specified format provider.
Namespace: System.TextAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public StringBuilder AppendFormat(
IFormatProvider provider,
string format,
params Object[] args
)
Parameters
- provider
- Type: SystemIFormatProvider
An object that supplies culture-specific formatting information. - format
- Type: SystemString
A composite format string (see Remarks). - args
- Type: SystemObject
An array of objects to format.
Return Value
Type:
StringBuilderA reference to this instance after the append operation has completed. After the append operation, this instance contains any data that existed before the operation, suffixed by a copy of
format where any format specification is replaced by the string representation of the corresponding object argument.
Exceptions Exception | Condition |
---|
ArgumentNullException | format is null. |
FormatException | format is invalid. -or-The index of a format item is less than 0 (zero), or greater than or equal to the length of the args array. |
ArgumentOutOfRangeException | The length of the expanded string would exceed MaxCapacity. |
See Also