Reputation: 2645
How can I convert the following string from
var x = "F:\RSSIMS\database\"
to:
var x = "F:\\RRSIMS\\database\\"
Thanks for all your help.
Upvotes: 0
Views: 66
Reputation: 46728
var x = "F:\RSSIMS\database\"
is already invalid. You need to escape your backslashes.
var x = "F:\\RSSIMS\\database\\";//stores the string `F:\RSSIMS\database\` in x.
If you want double-slashes now, do the below to replace all the single slashes by double ones.
x = x.replace(/\\/g,"\\\\");
Upvotes: 5