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

Related questions

2 answers 327 views
2 answers 258 views
258 views asked May 7, 2022 by avibootz
1 answer 280 views
1 answer 271 views
...