Phobos function to remove all occurances from dynamic array?

Liam McGillivray yoshi.pit.link.mario at gmail.com
Wed May 1 02:58:37 UTC 2024


On Wednesday, 1 May 2024 at 01:24:55 UTC, Lance Bachmeier wrote:
> Does filter do what you need?
>
> https://dlang.org/phobos/std_algorithm_iteration.html#.filter

It seems to do it with the following line:
```
allObjects = allObjects.filter!(element => element !is 
this).array;
```

So I've found a way to do it. It's still rather strange that it's 
so difficult to find the solution to such a common problem in the 
documentation.


More information about the Digitalmars-d-learn mailing list