Skip to content

Instantly share code, notes, and snippets.

@AdamBrodzinski
Created November 4, 2012 04:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save AdamBrodzinski/4010249 to your computer and use it in GitHub Desktop.
Save AdamBrodzinski/4010249 to your computer and use it in GitHub Desktop.
JavaScript replaceAt string method
// allows you to replace a strings char at a specific index
String.prototype.replaceAt=function(index, char) {return this.substr(0, index) + char + this.substr(index+char.length);}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment