Question: 3 0 . 9 . 2 : Use a recursive helper method to eliminate the need to extract substrings. 5 9 7 7 1 4

30.9.2: Use a recursive helper method to eliminate the need to extract substrings.
597714.2988516.qx3zqy7
Use a recursive helper method to make clean() more efficient, by eliminating the need to extract substrings.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import java.util.Scanner;
/**
* A recursive method that removes forbidden characters from a string.
*/
public class CleanUp
{
public static String cleanHelper(String str, String forbidden, int index)
{
/* Your code goes here */
if (forbidden.contains(current))
{
/* Your code goes here */
}
else
{
/* Your code goes here */
}

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 Programming Questions!