(Replace text) Write a program that replaces text in a file. Your program should prompt the user to enter a filename, an old string, and a new string. Here is a
sample run:
Enter a filename:test.txt
Enter the old string to be replaced:morning
Enter the new string to replace the old string:afternoon
Done
Sorry the answer is not available at the moment…
If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.
Spread the 'tradition of sharing'.