here the bsolute difference of ascii value is considered
if ( Math . abs ( s . charAt ( i ) - ' a ' ) > Math . abs ( s . charAt ( i ) - ' e ' ) ) s = s . substring ( 0 , i ) + ' e ' + s . substring ( i + 1 ) ; else s = s . substring ( 0 , i ) + ' a ' + s . substring ( i + 1 ) ; } else if ( s . charAt ( i ) > ' e ' && s . charAt ( i ) < ' i ' ) { if ( Math . abs ( s . charAt ( i ) - ' e ' ) > Math . abs ( s . charAt ( i ) - ' i ' ) ) s = s . substring ( 0 , i ) + ' i ' + s . substring ( i + 1 ) ; else s = s . substring ( 0 , i ) + ' e ' + s . substring ( i + 1 ) ; } else if ( s . charAt ( i ) > ' i ' && s . charAt ( i ) < ' o ' ) { if ( Math . abs ( s . charAt ( i ) - ' i ' ) > Math . abs ( s . charAt ( i ) - ' o ' ) ) s = s . substring ( 0 , i ) + ' o ' + s . substring ( i + 1 ) ; else s = s . substring ( 0 , i ) + ' i ' + s . substring ( i + 1 ) ; } else if ( s . charAt ( i ) > ' o ' && s . charAt ( i ) < ' u ' ) { if ( Math . abs ( s . charAt ( i ) - ' o ' ) > Math . abs ( s . charAt ( i ) - ' u ' ) ) s = s . substring ( 0 , i ) + ' u ' + s . substring ( i + 1 ) ; else s = s . substring ( 0 , i ) + ' o ' + s . substring ( i + 1 ) ; }