function replaceAll(str: string, find: string, replace: string) {
return str.replace(new RegExp(find, 'g'), replace);
}
let str: string = "typescript typescript c c++ typescript c# java python";
const tofind: string = "typescript";
str = replaceAll(str, tofind, '');
console.log(str);
/*
run:
" c c++ c# java python"
*/