Snippet

Coupez le premier caractère en JavaScript

6 réponses de la communauté

let str = 'Hello';
 
str = str.slice(1);
console.log(str);
 
/*
    Output: ello
*/
var string = "abcd";
console.log(string.substring(3)); //"d"
let str = " hello";
str = str.substring(1);
var newStr = str.substring(1);
var oldStr ="Hello";
var newStr = oldStr.substring(1); //remove first character "ello"
let str = 'Hello';
 
str = str.substring(1);
console.log(str);
 
/*
    Output: ello
*/