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

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

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

'Declaration
Public Shared Function Format ( _
	provider As IFormatProvider, _
	format As String, _
	ParamArray args As Object() _
) As String

Parameters

provider
Type: System.IFormatProvider

An object that supplies culture-specific formatting information.

format
Type: System.String

A composite format string.

args
Type: System.Object()

An object array that contains zero or more objects to format.

Return Value

Type: System.String
A copy of format in which the format items have been replaced by the string representation of the corresponding objects in args.

ExceptionCondition
ArgumentNullException

format or args is Nothing.

FormatException

format 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.

NoteNote

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft