format

format formatString ?arg ...?

Makes a string from a template, as printf of C does. %s is a string, %d an integer, %f, %e, and %g a float, %x hexadecimal, %c a character from its code, and %% a percent sign. A flag such as -, 0, or +, a width, and a precision go between % and the letter. %2$s takes the second argument.

Examples

A click on an example runs it in the shell of the page.

Errors

Facts