码迷,mamicode.com
首页 > 其他好文 > 详细

String.prototype.formatWith

时间:2017-05-24 12:35:12      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:orm   log   reg   rgs   cti   style   return   with   logs   

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     }

 

String.prototype.formatWith

标签:orm   log   reg   rgs   cti   style   return   with   logs   

原文地址:http://www.cnblogs.com/lizhanglong/p/6897869.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!