A random-access range with length and slicing.
haystack advanced such that needle is a prefix of it (if no such position exists, returns haystack advanced to termination).
import std.range.primitives : empty; int[] a = [ -1, 0, 1, 2, 3, 4, 5 ]; int[] b = [ 1, 2, 3 ]; assert(find(a, boyerMooreFinder(b)) == [ 1, 2, 3, 4, 5 ]); assert(find(b, boyerMooreFinder(a)).empty);
Finds needle in haystack efficiently using the Boyer-Moore method.