|
|
|
|
|
by mattmanser
3995 days ago
|
|
Most modern languages already have this feature, JavaScript's the strange one to not have a quick way of putting variables into a string and the first to have to name it though because it was missing it for so long. And by your comment have evidentally chosen a confusing name. This isn't to replace templating engines. Admittedly you could trivially extend the string prototype to have something more akin to string.format or printf, which was something you couldn't do in other languages for a long time, making it less of a problem. |
|
In python you can save a string like: template = '%s is %s' and _then_ evaluate its output: print template % ('john', 'tall')