Re: Keyed format specifier
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Keyed format specifier
- From: Norman Ramsey <nr@...>
- Date: 2008年1月03日 16:48:03 -0500
> > 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