format
fn
immutable(Char)[] format(Char, Args...)(in Char[] fmt, Args args) if (isSomeChar!Char)Converts its arguments according to a format string into a string.
The second version of format takes the format string as template argument. In this case, it is checked for consistency at compile-time and produces slightly faster code, because the length of the output buffer can be estimated in advance.
Parameters
fmt | a format string |
args | a variadic list of arguments to be formatted |
Char | character type of fmt |
Args | a variadic list of types of the arguments |
Returns
The formatted string.
Throws
A FormatException if formatting did not succeed.
See Also
sformat for a variant, that tries to avoid garbage collection.
fn
typeof(fmt) format(alias fmt, Args...)(Args args) if (isSomeString!(typeof(fmt)))ditto