File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String replacAll is not working

 
sambasivarao laghuvarapu
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9496
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ankit Garg
Sheriff
Posts: 9496
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String.replaceAll(...) has no effect on the original String.

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

should work.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic