How to remove all non-alphanumeric characters from a string in Node.js

1 Answer

0 votes
let str = "^no,de .js pr:og?£gr@()amm{}ing.!"; 
 
str = str.replace(/[^a-zA-Z0-9]/g, "");
 
console.log(str);
 
 
 
  
/*
run:
    
nodejsproggramming
   
*/

 



answered Jul 2, 2024 by avibootz

Related questions

...