How to add space after each comma in a string in Node.js

1 Answer

0 votes
let str = 'javascript,c++,c,typescript,node.js,php';

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

console.log(str); 

  
  
  
  
/*
run:
  
javascript, c++, c, typescript, node.js, php
  
*/

 



answered May 2, 2022 by avibootz

Related questions

...