format

LUA

format

format (FORMATSTRING, E1, E2,…)

Returns a formatted version of E1, E2,…following the description given in FORMATSTRING.Most printf rules are followed. Options/modiflers *, l, L, n, p, and h are not supported. q formats a string suitable to be safely read back by the Lua interpreter. All double quotes, newlines and backslashes are correctly escaped. Escape sequences are recognized. Conversions specifying the n-th argument uses the sequence %d$, where d is a decimal digit in the range [1-9], giving the position of the argument. E.g. For instance, %2$d converts the second argument. The options c, d, E, e, f, g, G, i, o, u, X, and x all expect a number as argument, whereas q and s expect a string. The * modifler can be simulated by building the appropriate format string. Neither the format string nor %s string values can contain embedded zeros. %q handles string values with embedded zeros