lua-users home
lua-l archive

Re: Keyed format specifier

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


 > > My apologies if this is the wrong place to suggest this, but how about 
 > > adding a keyed format specifier for string.format? ...
 >
 > This would be pretty easily done w/:
 > string.gsub("%(foo)s = %(bar)d", "%%%(([^)]+)%)", {foo = "variable", 
 > bar = 22})
 > 
 > you could abstract it a bit...
This is very nearly one of the examples in Roberto's book, which you
should rush out and buy!
Norman

AltStyle によって変換されたページ (->オリジナル) /