Reputation: 168
I dont know where I m going wrong.. I want to replace "
with ""
I have used the following code.
input.replaceAll("\"", "\"\"");
this doesnt seem to work. Any suggestions?
Upvotes: 1
Views: 455
Reputation: 137382
Strings are immutable, so you need to assign it into another String:
input = input.replaceAll("\"", "\"\"");
Upvotes: 1
Reputation: 5365
Strings are immutable, so when you "change" your string, you need to reassign it.
input = input.replaceAll("\"", "\"\"");
Upvotes: 1