import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class Test {
public static void main(String [] args){
List<String> testList = Arrays.asList("alibaba","baidu","amazon","bytedance","bilibili");
testList = testList.stream().filter(e->!e.startsWith("b")).collect(Collectors.toList());
System.out.println(testList);
}
}
list移除元素的方法
最新推荐文章于 2024-03-13 16:08:11 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)