js remove first n characters from string code example
Example 1: delete first character javascript
let str = 'Hello';
str = str.slice(1);
console.log(str);
Example 2: remove first 3 characters from string javascript
var string = "abcd";
console.log(string.substring(3));
Example 3: remove first char javascript
let str = 'Hello';
str = str.substring(1);
console.log(str);
Example 4: javascript get last n characters of string
'abc'.slice(-1);
Example 5: javascript remove first character from string
let str = 'ss';
str = new RegExp('^.(.*)').exec(str)[1];
Example 6: javascript remove first character from string
let str = 's';
str = (function f(s) {
return s.length<=1?'':f(s.slice(0, -1))+s[s.length-1]
})(str);