How to replace all forward slashes in a string with Node.js

1 Answer

0 votes
let str = '/node.js/c/python/c++';

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

console.log(str);
    
    
    
    
/*
run:
    
$node.js$c$python$c++
    
*/

 



answered Jul 2, 2022 by avibootz

Related questions

1 answer 131 views
1 answer 132 views
1 answer 133 views
1 answer 257 views
1 answer 113 views
1 answer 121 views
...