This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to replace a string in a string with another string?

 
Sri Nivas
Ranch Hand
Posts: 58
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The replace method for String object only replaces a char with another char.
I need a method which replaces a part of a string with another string?
What is the best method to do this?
 
Matt Senecal
Ranch Hand
Posts: 255
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the replace() method that StringBuffers use. I think that will work for you, and it's very easy to convert from a String to a StringBuffer and back again.
Originally posted by Srini Madgula:
The replace method for String object only replaces a char with another char.
I need a method which replaces a part of a string with another string?
What is the best method to do this?

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic