function Format()
{
var a = [].slice.apply( arguments ), s = a.shift();
return s.replace( /\{[0-9]+\}/g, function( d ){ return a[ d.slice( 1, -1 ) ]; } );
};
Format("select * from {0} where name='{1}'","table","chembo");
Javascript 格式化字符串
最新推荐文章于 2020-11-23 15:17:19 发布