Regex Help: Remove "" quotations from input name
I'm having trouble getting a program to remove the "" from a string that's being ready from a .csv file. Basically, what's happening is, sometimes, when someone saves a .csv using a spreadsheet program, it adds the "" before and after each entry (so basically what should be data,data2,data3 comes out as "data","data2","data3"). How do I remove the "" from the variable so that my script properly accesses the data it needs? I have an example of what I've tried below to test it:
for(i=0;i<bits.length;i++) {
bits.replace(/"(?=[^\[]*\])/g, ''); //remove "" quotations
alert(bits);
}
Unfortunately, this doesn't appear to do anything. No error and the "" are still in the variable when the alert displays. What am I doing wrong?
dgolberg