Question: FilterFirstLast.java package stringfilterfirstlast; public class FilterFirstLast { /** Searches text for the first and last instances of a given character. * Returns the text with

FilterFirstLast.java package stringfilterfirstlast; public class FilterFirstLast { /** Searches text for the first and last instances of a given character. * Returns the text with the first and last instances of character removed. * If the character does not appear in the text, the whole text must be returned intac * If the character only appears in the text once, then then the text must * be returned with the first instance of character removed. * e.g. "revere" ander would return "rver" 10 * @param text Text to be searched. 21 * @param searching For A character to search for in the text. 12 * Greturn Text with first and last instances of character removed. 13 14 public static String filterFirstLast(String text, char searching for) { 15 16 17) 1 NOO1 onih String filter first last Implement the function public static String filterFirstLast(String text, char searchingFor) in the manner described by the comments. The following may be useful: indexOf(2 substring 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
