How to replace all space in a string with specific character in JavaScript

1 Answer

0 votes
let s = "javascript  java c    c++ c#  php   python"

s = s.replace(/ /g, '*')

console.log(s); 




/*
run:

javascript**java*c****c++*c#**php***python

*/

 



answered May 25, 2021 by avibootz
...