A friendly place for programming greenhorns!
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
Author
replacing \' with ' in string
auvrm papu
Ranch Hand
Joined: Sep 01, 2005
Posts: 105
posted
Aug 03, 2009 11:28:00
0
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
posted
Aug 03, 2009 11:31:24
0
string.replace("\\\'", "'"); should work
JDBCSupport
-
An easy to use, light-weight JDBC framework
-
auvrm papu
Ranch Hand
Joined: Sep 01, 2005
Posts: 105
posted
Aug 03, 2009 15:43:04
0
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?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter