I have a string that involves tricky \\ characters.
Below is the initial code, and what I am literally trying to achieve but it is not working. I have to replace the \" characters but I think that is where the bug is.
var current = csvArray[0][i].Replace("\"", "");
I have tried the variation below but it is still not working.
var current = csvArray[0][i].Replace('\"', '');
It is currently throwing an Uncaught TypeError: csvArray[0][i].Replace is not a function
Is there a way for Javascript to take my string ("\"") literally like in C#? Kindly help me investigate. Thanks!
.replace()should start with a lowercase "r". Are you actually trying to replace a backslash, or just replace quotation marks?Replace is not a functionwhich means use replace second use escape sequence like replace("\\","") to replace slashC#code. I'm currently turning it intoJS. Btw, I'm trying to replace a backslash and an opening quotation mark though.\"\"not just a backslash. Escape sequence won't work