All string replacement function js

str.replace(/需要替换的字符串/g,"新字符串")

eg:

"yyyy-MM-dd-hh-mm-ss".replace(/-/g,"/")

结果如下:
"yyyy/MM/dd/hh/mm/ss"

eg: replacing a backslash slash 

alert($('#accept').combobox('getValue').replace("upload","doc").replace(/\\/g,"/"))

 

Note: https://www.cnblogs.com/cblogs/p/9293522.html

Guess you like

Origin blog.csdn.net/l_degege/article/details/90605724
Recommended