Returns a formatted version of its variable number of arguments
following the description given in its first argument (which must be a string).
The format string follows the same rules as the |
printf family of
standard C functions.
The only differences are that the options/modifiers
h are not supported
and that there is an extra option,
q option formats a string in a form suitable to be safely read
back by the Lua interpreter:
the string is written between double quotes,
and all double quotes, newlines, embedded zeros,
and backslashes in the string
are correctly escaped when written.
For instance, the call
string.format('%q', 'a string with "quotes" and \n new line')
will produce the string:
"a string with \"quotes\" and \
expect a number as argument,
s expect a string.
This function does not accept string values
containing embedded zeros,
except as arguments to the