Question: Complete the recursive function below, which replaces every occurrence of character c7 by character c2 in the input string str. For example, replaceRectabracadabra 'b) B)
Complete the recursive function below, which replaces every occurrence of character c7 by character c2 in the input string str. For example, replaceRectabracadabra 'b) "B") should return Tabracadabra public static String replaceRec(String str, char c1, char c2){ if (str.length 0) return str; { return } else { return } if A- B 1 E TIT U S X
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
