我有一个如下的字符串
var string1 = " folder\\subfolder1\\subfolder2 "
我想用 string1.replace 将“\”替换为“/”以便
var string2 = "folder/subfolder1/subfolder2"
我试过了
var rep = path.replace("\\", "/");
但不工作。有什么帮助吗?
我有一个如下的字符串
var string1 = " folder\\subfolder1\\subfolder2 "
我想用 string1.replace 将“\”替换为“/”以便
var string2 = "folder/subfolder1/subfolder2"
我试过了
var rep = path.replace("\\", "/");
但不工作。有什么帮助吗?