I have data from a CSV file enclosed in single quotes, for example:
'Company name' 'Price: $43.50' 'New York, New York'
I want to be able to replace single quotes at the beginning / end of a value, but leave quotes in the data, for example:
'Joe Diner' should become Joe Diner
I can do
updateString = theString.replace("^'", "").replace("'$", "");
but I wanted to know if I could combine it to make only one replacement.
java regex replace csv
George
source share