Layout.convert

Replaces the format item in a string with the string equivalent of each argument.

Parameters

formatStr const(T)[]

A string containing format items.

Return Value

Type: T[]

A copy of formatStr in which the items have been replaced by the string equivalent of the arguments.

Remarks: The formatStr parameter is embedded with format items of the form:

{index[,alignment][:format-string]}

  • index
    An integer indicating the element in a list to format.
  • alignment
    An optional integer indicating the minimum width. The result is padded with spaces if the length of the value is less than alignment.
  • _format-string
    An optional string of formatting codes.


The leading and trailing braces are required. To include a literal brace character, use two leading or trailing brace characters.

If formatStr is "{0} bottles of beer on the wall" and the argument is an int with the value of 99, the return value will be:
"99 bottles of beer on the wall".

Meta