Simple string membership test

Ian ian at iangarcia.net
Sat Feb 15 17:58:44 UTC 2025


Hi,

What's the best (idiomatic) way of checking if a string is in a 
list of strings:

```d
string v = "tofind";
if (v ismemberof ["abc", "def","tofind"])
    etc();
```

Thanks,
  ian


More information about the Digitalmars-d-learn mailing list