How to replace all occurrences of substring in a string case insensitive in Node.js

1 Answer

0 votes
let s = 'NODE.js c++ node.JS c java c#';
 
s = s.replace(/node.js/gi, 'node js');
 
console.log(s);
    
    
    
    
    
/*
run:
    
node js c++ node js c java c#
    
*/

 



answered Feb 5, 2022 by avibootz
...