Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将以下字符串从
var x = "F:\RSSIMS\database\"
到:
var x = "F:\\RRSIMS\\database\\"
感谢你的帮助。
var x = "F:\RSSIMS\database\"已经无效。你需要逃避你的反斜杠。
var x = "F:\\RSSIMS\\database\\";//stores the string `F:\RSSIMS\database\` in x.
如果您现在想要双斜杠,请执行以下操作以将所有单斜杠替换为双斜杠。
x = x.replace(/\\/g,"\\\\");