in reply to Best practice on escapes in interpolated strings
I, for some timenow, do it lke this:
"Page %(pg)d - Section %(sec)d - %(sec)s"
In a first step I extract from all the "%(something)" the "something" leaving just a % so that the examp string becomes:
"Page %d - Section %d - %s"
At the same time I push the "something"s onto an array.
I borrowed this syntax from python. The escaping should then simply be: Double the %:
%%(foo)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Best practice on escapes in interpolated strings (sprintfnamed)
by Anonymous Monk on Jul 29, 2013 at 11:49 UTC | |
by Skeeve (Parson) on Jul 29, 2013 at 12:12 UTC |