StringFormat Method (IFormatProvider, String, Object) |
Replaces the format item in a specified string with the string representation of a corresponding object in a specified array. A specified parameter supplies culture-specific formatting information.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public static string Format(
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 object array that contains zero or more objects to format.
Return Value
Type:
StringA copy of
format in which the format items have been replaced by the string representation of the corresponding objects in
args.
Exceptions Exception | Condition |
---|
ArgumentNullException | format or args is null. |
FormatException | format is invalid.-or- The index of a format item is less than zero, or greater than or equal to the length of the args array. |
See Also