字符串函数 replace() 方法妙用

alert('10 12 14 16'.replace(/d+/g,function(match){
    return parseInt(match,10) > 10 ? '*' : match;
}));

 这样就可以筛选出有条件的数据了 

posted @ 2014-12-17 15:36  路杰2015  阅读(153)  评论(0编辑  收藏  举报