Replace string by character - Node.js String

Node.js examples for String:Replace

Description

Replace string by character

Demo Code



String.prototype.replaceAt = function(index, character) {
  return this.substr(0, index) + character + this.substr(index+character.length);
};

Related Tutorials