Last active
September 11, 2018 13:53
-
-
Save smitroshin/b7a03ec776a58971a549467fd4553ede to your computer and use it in GitHub Desktop.
Removing character from string
This file contains 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 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