Replace Single Quote in Java using str.replaceAll()
December 10th, 20082 Comments
Replace Single Quote in Java using str.replaceAll()
To replace single quote in java you have to escape four times the single quote in replaceall string method.
String input = "Replace Single Quote's in Java";
String output = input.replaceAll(" ' ", "\\\\' ");
System.out.println(output);
String output = input.replaceAll(" ' ", "\\\\' ");
System.out.println(output);

Wednesday, December 10th, 2008 at 12:12 pm
Thanks this was rearlly useful to me..
Wednesday, December 10th, 2008 at 12:12 pm
ya!!!!!!
This is very very useful to me