Javascript String replaceAt(index, newChar)

Description

Javascript String replaceAt(index, newChar)


String.prototype.replaceAt = function(index, newChar) {
 return this.substring(0, index) + newChar + this.substring(index + 1, this.length + 1);
};



PreviousNext

Related