我想从某个过滤器上的列表中删除对象,并且有多个对象.
list.stream().filter(g->g.getName().equalsIgnoreCase("String")).forEach(result ->{
/* is it possible to get the index of the result here?
.remove(), will iterate through the list again. I don't want that.
*/
list.remove(result);
});
Run Code Online (Sandbox Code Playgroud)