I have string and I want to replace or remove words combination. Not one by one, not using

str = str.replace("green", "red");
str = str.replace("blue", "red")
etc...


I want something like

str.function("words combination", "red")