var today = "2018-12-25";var reg = new RegExp( '-' , "g" )//表示全局搜索平‘-’符号var newstr = today.replace( reg , '/' );//表示将全部的‘-’替换成‘/’符号spa