What I have is a string array that I am creating from a .csv file I am reading. I then want to parse the values I'm going to use for the ' character and replace it with a \' because I am outputting this to a javascript file.
Here's the code I'm using for that:
while ((thisLine = myInput.readLine()) != null) { String[] line = thisLine.split("\t"); if(line[4].indexOf("'") > -1){ System.out.println(line[4]); line[4] = line[4].replace("'", "\'"); System.out.println(line[4]); } brand.add(line[4]); } However this is not working. I am getting the same string back after I do the replace.
Is this because of some issue with the string array?
I appreciate any assistance in this matter.
"\\'".