标签:
String.prototype.format = function() { var args = arguments; return this.replace(/\{(\d+)\}/g, function(g0, g1) { return args[+g1]; }); } "hello {0},{0}‘s age is {1}".format("tom",12)
javascript 仿 C# format
原文地址:http://www.cnblogs.com/jh1994/p/5394875.html