I have a problem with the string symbol error, I want replace this symbol \, but it doesn't work. My sample code javascript like below the coding:
I am doing below this testing, cannot alert the message
var file_name = "C:\fakepath\claim 20210121 1754.sql";
var bbb = file_name.replace("C:\fakepath", "123");
alert(bbb);
If below the javascript code without \ , it can replace, the alert message is 123\fakepath\claim 20210121 1754.sql:
var file_name = "C:\fakepath\claim 20210121 1754.sql";
var bbb = file_name.replace("C:", "123");
alert(bbb);
Actually I want the alert message result is 123\claim 20210121 1754.sql
file_name.replace("C:\\fakepath", "123");with 2 backslashes