Skip to content

Instantly share code, notes, and snippets.

@sonlexqt
Forked from efenacigiray/replaceAt
Created November 16, 2017 08:13
Show Gist options
  • Save sonlexqt/e84f67af5ff6de15f6f4649b3accf7f2 to your computer and use it in GitHub Desktop.
Save sonlexqt/e84f67af5ff6de15f6f4649b3accf7f2 to your computer and use it in GitHub Desktop.
Javascript replace char at index
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