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