9 Years
Discussion Span
Last Post by m_sam6

If you want to replace all the occurrences of the word take a look at the replaceAll method, else if you would just want to replace the first occurrence of it, use the replaceFirst method. If you still want to do something else, such as replace an occurrence of the word after an occurrence of something else, wellm I have sited here the docs for the String class you can have a look at all the methods it has to offer and decide which suits you best or you could use a few of them in combination to get the desired outcome.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.