Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove single quotes in a string Java [closed]

Tags:

java

string

regex

I need some help to replace all the single quotes in a string.

This is my string: The State of the water = 'ICE'

I want to remove the single quotes around ICE.

like image 539
fiddle Avatar asked Aug 12 '15 07:08

fiddle


2 Answers

str = str.replaceAll("\'","");
like image 100
wawek Avatar answered Oct 27 '22 23:10

wawek


Use this

String str = "The State of the water = 'ICE'";
str = str.replaceAll("'","");
like image 45
Harshit Avatar answered Oct 27 '22 23:10

Harshit