my dog learned polymorphism*
The moose likes Beginning Java and the fly likes String replacAll is not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "String replacAll is not working" Watch "String replacAll is not working" New topic
Author

String replacAll is not working

sambasivarao laghuvarapu
Greenhorn

Joined: Jun 07, 2007
Posts: 9
Hi All,

I want to replace some string iam using the replaceAll method but it's not giving the proper output.can anyone explain what is the exact functionality of the string replaceAll method.

Thanks.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

Please take time to Carefully Choose One Forum when you start a topic. The servlet forum is not the correct forum for this question. I'll move it.


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

it's not giving the proper output


It doesn't work is not enough for anyone to help you. Please Tell The Details. You can read the documentation of String.replaceAll to know what it does...
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
String.replaceAll(...) has no effect on the original String.

String newString = oldString.replaceAll(...);

should work.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String replacAll is not working
 
Similar Threads
having issues replacing strings
String replace
Eliminating new line characters from a string
change a string
remove line feed and carriage return from a string