Click or drag to resize
StringFormat Method (String, Object)
Replaces one or more format items in a specified string with the string representation of a specified object.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static string Format(
	string format,
	Object arg0
)

Parameters

format
Type: SystemString
A composite format string (see Remarks).
arg0
Type: SystemObject
The object to format.

Return Value

Type: String
A copy of format in which any format items are replaced by the string representation of arg0.
Exceptions
ExceptionCondition
ArgumentNullExceptionformat is null.
FormatExceptionThe format item in format is invalid.-or- The index of a format item is not zero.
See Also