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.
indexOf to tell whether it had the word "war" in it or not.indexOf and substring to 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.