Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://www.lua.org/pil/20.html" rel="nofollow noreferrer">Chapter 20 of PiL</a> describes <code>string.format</code> near the end:</p> <blockquote> <p>The function <code>string.format</code> is a powerful tool when formatting strings, typically for output. It returns a formatted version of its variable number of arguments following the description given by its first argument, the so-called format string. The format string has rules similar to those of the <code>printf</code> function of standard C: It is composed of regular text and directives, which control where and how each argument must be placed in the formatted string.</p> </blockquote> <p>The <a href="http://www.lua.org/manual/5.1/manual.html#pdf-string.format" rel="nofollow noreferrer">Lua Reference</a> says:</p> <blockquote> <p>The format string follows the same rules as the <code>printf</code> family of standard C functions. The only differences are that the options/modifiers <code>*</code>, <code>l</code>, <code>L</code>, <code>n</code>, <code>p</code>, and <code>h</code> are not supported and that there is an extra option, <code>q</code>.</p> </blockquote> <p>The function is implemented by <a href="http://www.lua.org/source/5.1/lstrlib.c.html#str_format" rel="nofollow noreferrer"><code>str_format()</code> in <code>strlib.c</code></a> which itself interprets the format string, but defers to the C library's implementation of <code>sprintf()</code> to actually format each field after determining what type of value is expected (string or number, essentially) to correspond to each field.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload