String.Format Method (IFormatProvider, String, Object, Object)

.NET Framework (current version)
 

Replaces the format items in a specified string with the string representation of two specified objects. A parameter supplies culture-specific formatting information.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

public static string Format(
	IFormatProvider provider,
	string format,
	object arg0,
	object arg1
)

Parameters

provider
Type: System.IFormatProvider

An object that supplies culture-specific formatting information.

format
Type: System.String

A composite format string.

arg0
Type: System.Object

The first object to format.

arg1
Type: System.Object

The second object to format.

Return Value

Type: System.String

A copy of format in which format items are replaced by the string representations of arg0 and arg1.

Exception Condition
ArgumentNullException

format, arg0, or arg1 is null.

FormatException

format is invalid.

-or-

The index of a format item is less than zero, or greater than or equal to two.

System_CAPS_noteNote

For examples and comprehensive usage information about this and other overloads of the Format method, see the Format overload summary.

Universal Windows Platform
Available since 10
.NET Framework
Available since 4.6
Return to top
Show: