Variable fileLocation may get two kinds of strings
"N:\LDWG\PDF\2002P48.pdf""\\Gis1\GIS\LDWG\Pdf\2007P69.pdf"
I just want result to be like
"N:/LDWG/PDF/2002P48.pdf"
"//Gis1/GIS/LDWG/Pdf/2007P69.pdf"
respectively
Tried
fileLocation.replace(/\\/g,"/")
str.replace("\\", "/")
But didn't work.
Note: There is a double slash in 2nd string
var s = "N:\\LDWG\\PDF\\2002P48.pdf". Then, the string will look likeN:\LDWG\PDF\2002P48.pdf. YourfileLocation = fileLocation.replace(/\\/g,"/")will work.fileLocation.replace(/\\+/g,"/")fileLocation = fileLocation.replace(/\\/g,"/")