Skip to content

Instantly share code, notes, and snippets.

@alexko30
Created April 30, 2018 22:36
Show Gist options
  • Save alexko30/b578c424742f40c3dd5e8fbf1b40a0d8 to your computer and use it in GitHub Desktop.
Save alexko30/b578c424742f40c3dd5e8fbf1b40a0d8 to your computer and use it in GitHub Desktop.
remove First And Second Character From String
function removeFirstAndSecondCharacter(str) {
const strArray = str.split('');
const firstStarrPoint = 0;
strArray.splice(firstStarrPoint, 1);
strArray.pop();
let strNew = strArray.toString().replace(/,/g, '');
console.log(strNew);
}
removeFirstAndSecondCharacter('2Hello1');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment