Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can you show me how to complete thid method: squeeze ( String s, String t) so th

ID: 3661329 • Letter: C

Question

Can you show me how to complete thid method: squeeze ( String s, String t) so that it returns a String which identical to s, except that any characters found in String t are removed. Your method should never throw a RuntimeException. fill in the provided slots so the resulting code fragment satisfies the given requirement(s). Note: you may leave any particular slot empty-if it leaves legal java code, you may also add more statements, However you can NOT change or delete any of the given code.

---->

public static String squeeze(String s, String t)

{

String result = "";

______________________

for (int index=0; index <___________________; index ++)

{

if(________________________________________)

result = ______________________________________;

}

return result;

}




Explanation / Answer

Here you go. public static String squeeze(String s, String t) { String result = ""; int l1; l1=s.length(); for (int index=0; index 0) result = s.substring(0,j)+s.subtring(j+1); } return result; }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote