How to delete the first character of a string in Node.js

3 Answers

0 votes
let s = 'nodejs';
 
s = s.slice(1);
 
console.log(s);
 
  
  
      
      
/*
run:
  
odejs
      
*/

 



answered May 2, 2024 by avibootz
0 votes
let s = 'nodejs';
 
s = s.substring(1);
 
console.log(s);
 
  
  
      
      
/*
run:
  
odejs
      
*/

 



answered May 2, 2024 by avibootz
0 votes
let s = 'nodejs';
 
s = s.substr(1);
 
console.log(s);
 
  
  
      
      
/*
run:
  
odejs
      
*/

 



answered May 2, 2024 by avibootz
...