Node.js examples for String:Format
Format String, "Hello {0}.".format("there") -> "Hello there."
if (!String.prototype.format) { String.prototype.format = function() {/*from w w w . j a v a 2 s . co m*/ var args = arguments; return this.replace(/{(\d+)}/g, function(match, number) { return typeof args[number] != 'undefined' ? args[number] : match ; }); }; }