using System;
public class RemoveAllOccurrencesOfWordFromString_CSharp
{
public static string RemoveAllOccurrencesOfWordFromString(string s, string toremove) {
s = s.Replace(" " + toremove + " ", " ");
s = s.Replace(" " + toremove, "");
s = s.Replace(toremove + " ", "");
return s;
}
public static void Main(string[] args)
{
string s = "java c# rust java c c++ java java golang python java";
s = RemoveAllOccurrencesOfWordFromString(s, "java");
Console.WriteLine(s);
}
}
/*
run:
c# rust c c++ golang python
*/