How to split a string by specific character into an array with JavaScript

1 Answer

0 votes
let s = 'javascript*php*c*c++*java*python*c#';

let arr = s.split('*');

console.log(arr);
  
    
    
    
/*
run:
    
["javascript", "php", "c", "c++", "java", "python", "c#"]
    
*/

  

 



answered Feb 3, 2021 by avibootz
...