How about a function called contains() for the module std.array?

Adam D. Ruppe destructionator at gmail.com
Sat Oct 19 21:58:55 UTC 2019


On Saturday, 19 October 2019 at 21:47:57 UTC, Murilo wrote:
> I did not find such function

It is called `canFind`

http://dpldocs.info/experimental-docs/std.algorithm.searching.canFind.canFind.3.html


import std.algorithm.searching;
import std.stdio;

void main() {
         bool f = [1,2,3,4,5,6].canFind([3,5,6]);
         writeln(f);
}


More information about the Digitalmars-d mailing list