Question: 2. Write a program, called RemoveText, that removes all the occurrences of a specified string from a text file. The specified string and file are
2. Write a program, called RemoveText, that removes all the occurrences of a specified string from a text file. The specified string and file are both input as command line parameters. For example, invoking java Remove Text John example.txt removes string John from the specified file "example.txt". The program shall display "Plz use this format: java Task2T8 String filename" if the parameters are not properly provided and then terminate the program, and display "The specified file is not exist!" if the specified file is not existed and then terminate. 2. Write a program, called RemoveText, that removes all the occurrences of a specified string from a text file. The specified string and file are both input as command line parameters. For example, invoking java Remove Text John example.txt removes string John from the specified file "example.txt". The program shall display "Plz use this format: java Task2T8 String filename" if the parameters are not properly provided and then terminate the program, and display "The specified file is not exist!" if the specified file is not existed and then terminate
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
