Replaces characters on specified indices in the input text.

@param {string} text The original text, for which the characters have to be substituted.
@param {Array} indices The array of indices that have to be substituted.
@param {string} substitute The character that is used to substitute in the text.

@returns {string} result The string of the original text with the characters on specified indices are substituted with the substitute character.
function replaceCharactersByIndex( text, indices, substitute ) {
	const modifiedTextSplitByLetter = text.split( "" );

	indices.forEach( function( index ) {
		modifiedTextSplitByLetter.splice( index, 1, substitute );
	} );

	return modifiedTextSplitByLetter.join( "" );
}