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; }Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.