function removeWord(str : string, word : string) {
if (str.includes(word)) {
let tmp : string = word + " ";
str = str.replace(tmp, "");
tmp = " " + word;
str = str.replace(tmp, "");
}
return str;
}
let str : string = "typescript c c++ c# python rust go";
const word : string = "rust";
str = removeWord(str, word);
console.log(str);
/*
run:
"typescript c c++ c# python go"
*/