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

Murilo murilomiranda92 at hotmail.com
Sun Oct 20 02:19:06 UTC 2019


On Saturday, 19 October 2019 at 21:58:55 UTC, Adam D. Ruppe wrote:
> 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);
> }

That unfortunately returned false.


More information about the Digitalmars-d mailing list