摘要: 1. 格式化 formatfunction format(string) { var args = arguments; var pattern = new RegExp(“%([1-" + arguments.length + "])”, ”g”); return String(string).replace(pattern, function(match, index) { return args[index]; }); };//调用 format(“And the %1 want to know whose %2 you %3″, ”papers”, ... 阅读全文
posted @ 2013-04-10 11:44 zhaoping 阅读(185) 评论(0) 推荐(0) 编辑