replace替换一种字符
var time='2017/04/19';
console.log(time.replace(/\//g,""));
20170419
\是转义的意思
/g可以替换掉全部匹配的字符
replace替换多种字符
var time='2017-04-19T12:13:33.333';
console.log(time.replace(/[-,T,:,.]/g,"");
20170419121333333
匹配多个字符正则:[-,:,a]
replace替换一种字符
var time='2017/04/19';
console.log(time.replace(/\//g,""));
20170419
\是转义的意思
/g可以替换掉全部匹配的字符
replace替换多种字符
var time='2017-04-19T12:13:33.333';
console.log(time.replace(/[-,T,:,.]/g,"");
20170419121333333
匹配多个字符正则:[-,:,a]