lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I often do that, but rather with the "%" operator as in Python:

print("hello %s" % { "world" }).

When it's likely to take more than a couple of replacements, implementing variable substitution is worth it:

page = [[<html><head>$head</head><body>$body</body></html>]] % { head="this", body="that" }