String.Format Method (String, Object)
Replaces one or more format items in a specified string with the string representation of a specified object.
Assembly: mscorlib (in mscorlib.dll)
Return Value
Type: System.StringA copy of format in which any format items are replaced by the string representation of arg0.
| Exception | Condition |
|---|---|
| ArgumentNullException | format is null. |
| FormatException | The format item in format is invalid. -or- The index of a format item is not zero. |
Note |
|---|
For examples and comprehensive usage information about this and other overloads of the Format method, see the Format overload summary. |
Available since 10
.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Format Overload
String Class
System Namespace
Formatting Types in the .NET Framework
Composite Formatting
Standard Date and Time Format Strings
Custom Date and Time Format Strings
Standard Numeric Format Strings
Custom Numeric Format Strings
Standard TimeSpan Format Strings
Custom TimeSpan Format Strings
Enumeration Format Strings
.jpeg?cs-save-lang=1&cs-lang=csharp)