1. 替换字符串中所有指定的字符 var str = '2016-09-19'; var result = str.split('-').join(''"); console.log(result); OUT 20160919