aspose file tools
The moose likes Java in General and the fly likes replacing \' with ' in string Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "replacing \ Watch "replacing \ New topic
Author

replacing \' with ' in string

auvrm papu
Ranch Hand

Joined: Sep 01, 2005
Posts: 105
I'm trying to find and replace all \' to '

basically

input = "Hello \' Here is \' quote";
ouput = "Hello ' Here is ' quote";

The following didn't help
Pattern pattern = Pattern.compile("[\\\\']");

Any help is appreciated.
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
string.replace("\\\'", "'"); should work


JDBCSupport - An easy to use, light-weight JDBC framework -
auvrm papu
Ranch Hand

Joined: Sep 01, 2005
Posts: 105
Thanks,

Actually string.replaceAll("\\\\'", "'")); worked!
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: replacing \' with ' in string
 
Similar Threads
Decorator Design Pattern
javascript for disable back button
component diagram
Abstract Factory and Factory Pattern applied to Sun's Blueprint on DAO
how to implement multicasting in java?