标签:
var format = function(s, arg0) {
var args = arguments;
return s.replace(/\{(\d+)\}/ig, function(a, b) {
return args[(b | 0) + 1] || ‘‘;
});
};
console.log(format("{0} love {1}.",‘I‘,‘You‘));
标签:
原文地址:http://www.cnblogs.com/liangxuru/p/4736945.html