String.prototype.formatWith

1     String.prototype.formatWith = function () {
2         var args = arguments;
3         var reg = /{(d+)}/g;
4         return this.replace(reg, function (g0, g1) {
5             return args[+g1] || '';
6         });
7     }
原文地址:https://www.cnblogs.com/lizhanglong/p/6897869.html