Reputation: 1257
I have two lists : _bufferCarnetList
and _deletedWords
.
When the user hits OK: I want to remove from _bufferCarnetList
the items contained in _deletedWords
.
I have tried using the .remove
method, but nothing happens.
_bufferCarnetList.remove(_deletedWords).
Is there a way to do it in a direct way, or should I iterate the list and remove each item separately ?
Upvotes: 2
Views: 633
Reputation: 7298
Use the removeWhere
method:
_bufferCarnetList.removeWhere((e) => _deletedWords.contains(e));
Upvotes: 4