📅  最后修改于: 2022-03-11 14:52:24.403000             🧑  作者: Mango
String str = "manchester united (with nice players)";
System.out.println(str.replace("(with nice players)", ""));
int index = str.indexOf("(");
System.out.println(str.substring(0, index));