How to replace all underscores with spaces in a string with JavaScript

1 Answer

0 votes
let str = 'javascript_java_c_c++_php';

str = str.replaceAll('_', ' ');

console.log(str); 

   
   
   
   
/*
run:
   
"javascript java c c++ php"
   
*/

 



answered Apr 25, 2022 by avibootz
...