I'm trying to replace in a string any backslash (\) with a normal slash(/).
The string .replace method requires a RegExp as parameter. My current code is the following:
var regexBackslash = new RegExp("\\\\");
while(sPath.search(regexBackslash)>=0){
sPath=sPath.replace(regexBackslash,"/");
}
This works but the RegExp("\\\\") part acts odd in the script IDE as any comment afterwards (with //) is colored like its code.
Do I have to escape the the backslash differently?