Question: 2. RemoveCharacter. Write a method removeCharacter that accepts a string str, a character c and an integer n as arguments, such that the string str

 2. RemoveCharacter. Write a method removeCharacter that accepts a string str,

2. RemoveCharacter. Write a method removeCharacter that accepts a string str, a character c and an integer n as arguments, such that the string str contains at least n times the character c. The method returns the resulting string after removing the first n occurrences of the character c from the original string str (the method should not print anything to the console). The signature of the method should be: public static String removeCharacter(String str, char c, int n) Use this method to write a program RemoveCharacter.java that takes as command line arguments an integer N followed by N tuples; each tuple consists of a string, a character and an integer (str, c, n). The program should print each of the strings after removing the first n occurrences of the character c from the corresponding string str. Example: java RemoveCharacter 3 test t 1 shaaaady a 4 testtt t 2 est shdy estt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!