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:fakepathclaim 20210121 1754.sql"; var bbb = file_name.replace("C:fakepath", "123"); alert(bbb);
Backslash begins escape sequences, you need to double them to make them literal.
var file_name = "C:\fakepath\claim 20210121 1754.sql"; var bbb = file_name.replace("C:\fakepath", "123"); alert(bbb);
2.1m questions
2.1m answers
60 comments
57.0k users