Atom

text.format()

Formats values at positional {} markers.

Signature

text.format(template, ...values)

Parameters

Text template, then one Atom value per placeholder.

Returns

String.

Behavior

Doubling braces emits literal braces. Escape opening brace characters in Atom literals before passing them to this function.

Errors

Malformed braces, too few or too many values.

Example

Atom
use text
assert(text.format('score: \{}', 3) == 'score: 3')