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,"/"))
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,"/"))