The US Department of Defense used to be called the War Department. I wouldn't be surprised if the public relations gurus eventually change it to Department of Peace.
In this same spirit you should write a program to produce world peace
by scanning the input for the word "war" and replace it with "peace".
The Java function
replace may not be used for this --
you have to write it yourself.
indexOfto tell whether it had the word "war" in it or not.
substringto extract the part before "war" and after "war" and build a new string where "war" is replaced by "peace".
Upper- and lowercase are problems. Add code to deal with case problems.