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 167 views
2 answers 147 views
147 views asked May 7, 2022 by avibootz
1 answer 189 views
1 answer 178 views
...