printf in lua

Lua doesn't have a C-like printf function. However, it has a Java-like string.format function and it allows variable-length arguments, so rolling you own printf is very easy indeed:

function printf(...)
 io.write(string.format(...))
end
Avatar
Lydéric Landry
écrivain et éditeur

Après plusieurs vies, j'écris maintenant