Tuple List

Salih Dincer salihdb at hotmail.com
Wed Sep 4 08:45:04 UTC 2024


On Wednesday, 4 September 2024 at 08:04:58 UTC, drug007 wrote:
> 
> You should use filter instead of find. Find finds the first 
> element and returns the range from that first element to the 
> end of the original range.

Thank you, it's my mistake. We confused HOF, which has the same 
first letter. So, if we turn the question towards the associative 
array, can a similar one be done without using each or foreach? 
For example:

```d
auto l2 = ["WC": 0, "Mutfak": 41,
     "Salon": 42, "Atelye": 0
   ];

   l2.values.filter!"a > 0".writeln;
   // [41, 42]
   foreach(key, value; l2)
     if(value > 0) key.write(", ");

   // Mutfak, Salon,
```




More information about the Digitalmars-d-learn mailing list