how to filter associative arrays with foreach ?

someone someone at somewhere.com
Mon Jun 21 22:28:12 UTC 2021


On Monday, 21 June 2021 at 21:00:42 UTC, Elronnd wrote:
> Here's how I would do it:
>
> foreach (k, v; coll) {
>     if (k == unwanted) continue;
>     ...
> }
>
> You still have an if, but the actual loop body doesn't have to 
> be nested, so it's easy to follow the control flow.

almost the same


More information about the Digitalmars-d-learn mailing list