1let str = 'Hello';
2
3str = str.slice(1);
4console.log(str);
5
6/*
7 Output: ello
8*/
9
1String string = "Hello World";
2
3//Remove first character
4string.substring(1); //ello World
5
6//Remove last character
7string.substring(0, string.length()-1); //Hello Worl
8
9//Remove first and last character
10string.substring(1, string.length()-1); //ello Worl
1let str = 'Hello';
2
3str = str.substring(1);
4console.log(str);
5
6/*
7 Output: ello
8*/
9