im a student learning java so apologies if this very easy and straight forward.
i am wanting to replace all occurrences of a word in a long string with another word, for example if i am wanting to change all occurrences of the word "very" with "extremely" in the following string.
string story = "He became a well decorated soldier in the line of fire when he and his men walked into the battle. He acted very bravely and he was very courageous."
i am guessing i would use the
replaceAll() method but would i simply insert the words such as
story.replaceAll("very ", "extremely ");