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

1 Answer

0 votes
let str = 'javascript typescript node.js python';
 
str = 'M' + str.substring(1);
 
console.log(str); 

   
   
   
   
/*
run:
   
Mavascript typescript node.js python
   
*/

 



answered Jul 3, 2022 by avibootz
...