src/Recursion/recursion3.java
public static String removeHi(String str, int i) {
		if (i == str.length() - 1 || i == str.length())
			return str;

		if (str.charAt(i) == 'h' && str.charAt(i + 1) == 'i') {

			if (i + 2 <= str.length() - 1)
				str = str.substring(0, i) + str.substring(i + 2);
			else
				str = str.substring(0, i);

			i = i - 1;
		}

		return removeHi(str, i + 1);

	}
//	remove all the occurrences of a word in a string
remove all the occurrences of a word in a string
remove all the occurrences of a word in a string
public static String removeHi(String str, int i) {
		if (i == str.length() - 1 || i == str.length())
			return str;
		if (str.charAt(i) == 'h' && str.charAt(i + 1) == 'i') {
			if (i + 2 <= str.length() - 1)
				str = str.substring(0, i) + str.substring(i + 2);
			else
				str = str.substring(0, i);
			i = i - 1;
		}
		return removeHi(str, i + 1);
	}
public static String removeHi ( String str , int i ) { if ( i == str . length ( ) - 1 || i == str . length ( ) ) return str ; if ( str . charAt ( i ) == 'h' && str . charAt ( i + 1 ) == 'i' ) { if ( i + 2 <= str . length ( ) - 1 ) str = str . substring ( 0 , i ) + str . substring ( i + 2 ) ; else str = str . substring ( 0 , i ) ; i = i - 1 ; } return removeHi ( str , i + 1 ) ; }
remove all the occurrences of a word in a string
remove all the occurrences of a word in a string