lua-users home
lua-l archive

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


Thomas Harning wrote:
This would be pretty easily done w/:
string.gsub("%(foo)s = %(bar)d", "%%%(([^)]+)%)", {foo = "variable", bar = 22})

you could abstract it a bit...

Thanks, I'd forgotten you could pass a table or a function to string.gsub()

Erik von Reis