Format Specifiers: Positional Parameters and Format

This lesson explains how to position parameters in format specifiers, followed by a discussion of the `format()` function of the `std.string` module.

Positional parameters #

We have seen above that the arguments are associated one by one with the specifiers in the format string. It is also possible to use position numbers within format specifiers. This enables the specifiers to associate with specific arguments. Arguments are numbered in increasing fashion, starting with 1. The argument numbers are specified immediately after the % character, followed by a $:

Get hands-on with 1400+ tech skills courses.