首页 > 技术文章 > js替换字符串
aknife 2020-04-23 16:55 原文
str.replace(/需要替换的字符串/g,"新字符串")
"yyyy-MM-dd-hh-mm-ss".replace(/-/g,"/") 结果如下: "yyyy/MM/dd/hh/mm/ss"