How to replace all forward slashes in a string with TypeScript

1 Answer

0 votes
let str = '/typescript/c/php';

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

console.log(str);
    
    
    
    
/*
run:
    
"$typescript$c$php" 
    
*/

 



answered Jul 2, 2022 by avibootz

Related questions

...