src/Recursion/recursion3.java
public static String replaceD(String str, int i) {

		if (i == str.length() - 1 || i == str.length()) {
			return str;
		}

		if (str.charAt(i) == str.charAt(i + 1)) {
			str = str.substring(0, i + 1) + "*" + str.substring(i + 1);
		}

		return replaceD(str, i + 1);

	}
//	replace duplicate character of a string with *
replace duplicate character of a string with
replace duplicate character of a string with
public static String replaceD(String str, int i) {
		if (i == str.length() - 1 || i == str.length()) {
			return str;
		}
		if (str.charAt(i) == str.charAt(i + 1)) {
			str = str.substring(0, i + 1) + "*" + str.substring(i + 1);
		}
		return replaceD(str, i + 1);
	}
public static String replaceD ( String str , int i ) { if ( i == str . length ( ) - 1 || i == str . length ( ) ) { return str ; } if ( str . charAt ( i ) == str . charAt ( i + 1 ) ) { str = str . substring ( 0 , i + 1 ) + "*" + str . substring ( i + 1 ) ; } return replaceD ( str , i + 1 ) ; }
replace duplicate character of a string with
replace duplicate character of a string with