FormattableString.Format Property

Definition

Returns the composite format string.

public:
 abstract property System::String ^ Format { System::String ^ get(); };
public abstract string Format { get; }
member this.Format : string
Public MustOverride ReadOnly Property Format As String

Property Value

The composite format string.

Remarks

A composite format string consists of zero or more runs of fixed text intermixed with one or more format items, which are indicated by an index number delimited with brackets (for example, {0}). The index of each format item corresponds to an argument in an object list that follows the composite format string. For example, in the following statement:

String.Format("Name = {0}, hours = {1:hh}", name, DateTime.Now);
String.Format("Name = {0}, hours = {1:hh}", name, DateTime.Now)
String.Format("Name = {0}, hours = {1:hh}", name, DateTime.Now)

the composite format string is "Name = {0}, hours = {1:hh}".

Applies to

See also