-
-
Save sonlexqt/e84f67af5ff6de15f6f4649b3accf7f2 to your computer and use it in GitHub Desktop.
Javascript replace char at index
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
function replaceAt(string, index, replace) { | |
return string.substring(0, index) + replace + string.substring(index + 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment