This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
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?
There's nothing more dangerous than a resourceful idiot. ---Dilbert