StringFormat Method
 

Replaces the format items in a specified string with the string representation of two specified objects.

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

Syntax
public static string Format(
	string format,
	object arg0,
	object arg1
)
public:
static String^ Format(
	String^ format,
	Object^ arg0,
	Object^ arg1
)
static member Format : 
        format:string *
        arg0:Object *
        arg1:Object -> string
Public Shared Function Format (
	format As String,
	arg0 As Object,
	arg1 As Object
) As String

Parameters

format
Type:

A composite format string.

arg0
Type:

The first object to format.

arg1
Type:

The second object to format.

Return Value

Type:

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

Exceptions
Exception Condition
ArgumentNullException

format is null.

FormatException

format is invalid.

-or-

The index of a format item is not zero or one.

Remarks
System_CAPS_noteNote

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

Version Information
Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top