Search code examples
stringluastring-formatting

Lua string.format options


This may seem like a stupid question, but what are the symbols used for string replacement in string.format? can someone point me to a simple example of how to use it?


Solution

  • string.format in Lua follows the same patterns as Printf in c:

    https://cplusplus.com/reference/cstdio/printf/

    There are some exceptions, for those see here:

    http://pgl.yoyo.org/luai/i/string.format