input validation

bearophile bearophileHUGS at lycos.com
Wed Mar 4 11:57:49 PST 2009


Andrei Alexandrescu:
> int[] a = [ 1, 2, 3, 4 ];
> int[] b = [ 2. 3 ];

I guess you meant:

int[] b = [ 2, 3 ];

> find(a, b);
> find(assumeSorted(a), b);
> find(a, assumeSorted(b));
> find(assumeSorted(a), assumeSorted(b));
> find(a, boyerMooreFinder(b));

Are you talking about finding the position of a subarray into a bigger array? Then the two useful cases are:
a.index(b);
a.indexBoyerMoore(b);
The other cases aren't common enough, I think.

Bye,
bearophile



More information about the Digitalmars-d mailing list