String.prototype.format = function() {
var args = arguments;
return this.replace(/\{(\d+)\}/g,
function(m, i) {
return args[i];
});
}
var testString = "<p>此次更新内容:</p>{0}<p>是否现在更新?</p>";
console.log(testString.format("1.我是测试的</br>2.是否是测试的"));