Replace S [ i ] with vow [ j ] iif S [ i ] is a vowel , and increment j by 1
if ( S . charAt ( i ) == ' a ' || S . charAt ( i ) == ' e ' || S . charAt ( i ) == ' i ' || S . charAt ( i ) == ' o ' || S . charAt ( i ) == ' u ' ) { S = S . substring ( 0 , i ) + tempArray [ j ++ ] + S . substring ( i + 1 , n ) ; } }