Java Regex to remove start/end single quotes but leave inside quotes

后端 未结 2 1525
后悔当初
后悔当初 2020-12-20 17:39

I have data from a CSV file that is enclosed in single quotes, like:

\'Company name\'
\'Price: $43.50\'
\'New York, New York\'

I want to be

2条回答
  •  忘掉有多难
    2020-12-20 18:18

    You could use the or operator.

    updateString = theString.replaceAll("(^')|('$)","");
    

    See if that works for you :)

提交回复
热议问题