Skip to content

Instantly share code, notes, and snippets.

@eduavila
Forked from efenacigiray/replaceAt
Created August 13, 2018 20:09
Show Gist options
  • Save eduavila/43ce003731d6a2a8c2f2f7a7c5a4f13a to your computer and use it in GitHub Desktop.
Save eduavila/43ce003731d6a2a8c2f2f7a7c5a4f13a 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