I have a list of thousands of strings that may come in the form:
word
or
"more than one word"
I want to remove the "" whenever they are present, so that I can save the string to my DB.
I'm wondering which method is faster:
- Using
line.replace("\"",""); - Validating that first character is '"', then making a substring from character 1 to length - 1.
Or even, is there a better way to do this?
Aucun commentaire:
Enregistrer un commentaire