Click or drag to resize
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: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
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: String
A copy of format in which the format items have been replaced by the string representation of the corresponding objects in args.
Exceptions
ExceptionCondition
ArgumentNullExceptionformat or args is null.
FormatExceptionformat 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