I am trying to get some items from a list, but `find` gives me unexpected results.

```
import std.stdio;
import std.algorithm;

int[] x = [1, 2, 3, 4, 5, 1, 2, 3];

void main()
{
    auto selection = x.find!(a => a == 2);

    foreach(item;selection)
    {
        writeln(item);
    }
}
```

Output is 2, 3, 4, 5, 1, 2, 3

Basically, I am looking for Where from C#.
  • D equivalent for... Python via Digitalmars-d-learn
    • Re: D equiv... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
      • Re: D e... Python via Digitalmars-d-learn
        • Re:... Ali Çehreli via Digitalmars-d-learn
          • ... Jonathan M Davis via Digitalmars-d-learn
    • Re: D equiv... monkyyy via Digitalmars-d-learn

Reply via email to