How to split a string by . - = _ / in Node.js

1 Answer

0 votes
const str = 'javascript.c++.c-typescript=nodejs_php/vb';

const arr = str.split(/[.\-=/_]/);

console.log(arr);


  
  
 
  
/*
run:
  
[ 'javascript', 'c++', 'c', 'typescript', 'nodejs', 'php', 'vb' ]
  
*/

 



answered Apr 30, 2022 by avibootz

Related questions

...