How to concatenate string replace in TypeScript

1 Answer

0 votes
function concatenate_replace(str: string) {
    str = str.substring(11).replace("free","FREE").replace("developed","");
     
    return str;
}
 
let str: string = "TypeScript is a free and open-source high-level programming language developed by Microsoft";
 
str = concatenate_replace(str);
 
console.log(str);
 
 
 
 
 
/*
run:
 
"is a FREE and open-source high-level programming language  by Microsoft" 
 
*/

 



answered Dec 9, 2023 by avibootz
...