0

I read a line from a txt file containing a string = "abc,"".

If one wanted to replace string to: string = "abc", one would write

string = string.replace(",",""); to replace the comma, but how would one replace the "?

Problem:

string = string.replace(""","");//code does not work because of """
Elysian Storm
  • 788
  • 6
  • 18

1 Answers1

2

You need to escape the ", so like this:

string = string.replace("\"","")
Daniel Jacob
  • 1,455
  • 9
  • 17