Skip to content

Instantly share code, notes, and snippets.

@smitroshin
Last active September 11, 2018 13:53
Show Gist options
  • Save smitroshin/b7a03ec776a58971a549467fd4553ede to your computer and use it in GitHub Desktop.
Save smitroshin/b7a03ec776a58971a549467fd4553ede to your computer and use it in GitHub Desktop.
Removing character from string
function removeCharacter(str, charPos) {
part1 = str.substring(0, charPos);
part2 = str.substring(charPos + 1, str.length);
return `${part1}${part2}`;
}
export default removeCharacter;
// console.log(remove_character("Python",3));
// Output: Pyton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment