How to concatenate strings with a separator in TypeScript

1 Answer

0 votes
const str1 = 'typescript';
const str2 = 'c';
const str3 = 'c++';

const str = [str1, str2, str3].join('-');

console.log(str); 


  
  
  
  
/*
run:
  
"typescript-c-c++" 
  
*/

 



answered May 29, 2022 by avibootz

Related questions

...