String.prototype.replaceAt = function (index, char) { return this.substr(0, index) + char + this.substr(index + char.length); } mystring.replaceAt(4, '')