Created
April 30, 2017 07:51
-
-
Save Ashkanph/7fc195ada157dad16551177deb488957 to your computer and use it in GitHub Desktop.
A prototype javascript function to change (replace) a character in a string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String.prototype.replaceAt=function(index, character) { | |
| return this.substr(0, index) + character + this.substr(index+character.length); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment