public class Main {
static String removeWord(String str, String word) {
String[] words = str.toLowerCase().split(" ");
String new_str = "";
for (String s : words) {
if (!s.equals(word)) {
new_str += s + " ";
}
}
return new_str;
}
public static void main(String[] args) {
String s = "rust java c c++ java c# java golang python";
s = removeWord(s, "java");
System.out.println(s);
}
}
/*
run:
rust c c++ c# golang python
*/