How to convert a comma separated string to array in TypeScript

1 Answer

0 votes
const str = "typescript,php,c,c++,python";
 
const arr = str.split(',');
 
console.log(arr);
 
 
     
     
/*
run:
     
["typescript", "php", "c", "c++", "python"] 
     
*/

 



answered Jun 19, 2022 by avibootz

Related questions

...