How to remove the only the first underscore from a string in TypeScript

1 Answer

0 votes
let str = 'typescript_c_c++_php';
 
str = str.replace(/_/, '');
 
console.log(str);
 
   
   
   
   
/*
run:
   
"typescriptc_c++_php" 
   
*/

 



answered Apr 27, 2022 by avibootz
...