Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: String.replaceAll(String regex, String replacement) question

Reply
Thread Tools

Re: String.replaceAll(String regex, String replacement) question

 
 
Mladen Adamovic
Guest
Posts: n/a
 
      12-04-2003
I tried to replace all " with \".
s=s.replaceAll("[\"]","\\\"");
but it does nothing!! String remains the same!!!

I tried then
s=s.replaceAll("[\Q"\E]","\Q\"\E")
but I got five sintax error?!?!?!?

I'm using JDK 1.4.2_01.

What's wrong?

P.S. It was a typing error in first message I posted about this.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
'System.String[]' from its string representation 'String[] Array' =?Utf-8?B?UmFqZXNoIHNvbmk=?= ASP .Net 0 05-04-2006 04:29 PM
command string good in subprocess.Popen(string) fails inprocess.Process(string) Earl Eiland Python 3 05-16-2005 04:48 PM
Is "String s = "abc";" equal to "String s = new String("abc");"? Bruce Sam Java 15 11-19-2004 06:03 PM
String[] files = {"a.doc, b.doc"}; VERSUS String[] files = new String[] {"a.doc, b.doc"}; Matt Java 3 09-17-2004 10:28 PM
String.replaceAll(String regex, String replacement) question Mladen Adamovic Java 3 12-05-2003 04:20 PM



Advertisments