How to replace the first character in a string with multiple characters in Node.js

1 Answer

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

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

 



answered Jul 3, 2022 by avibootz
...