How to delete the first character of a string in TypeScript

2 Answers

0 votes
let s: string = 'typescript';
 
s = s.slice(1);
 
console.log(s);
 
  
  
      
      
/*
run:
  
"ypescript" 
      
*/

 



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

 



answered May 2, 2024 by avibootz
...