This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "String replacAll is not working" Watch "String replacAll is not working" New topic

String replacAll is not working

sambasivarao laghuvarapu

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.

Ankit Garg

Joined: Aug 03, 2008
Posts: 9399

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

Joined: Aug 03, 2008
Posts: 9399

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: String replacAll is not working
It's not a secret anymore!