If found, the index of the first occurrence, or the length of "str" otherwise.
test!("==")(StringSearch!().locatePattern("Hello World!", "World", 0), 6); test!("==")(StringSearch!().locatePattern("[Hello]", "[", 1), "[Hello]".length); test!("==")(StringSearch!().locatePattern("[Hello]", "[", 256), "[Hello]".length); // Crazy/inconsistent behavior: It should return 1 test!("==")(StringSearch!().locatePattern("[", "[", 1), 0); test!("==")(StringSearch!().locatePattern("[", "[", 256), 0);
Scans "str" for "pattern" and returns the index of the first occurrence if found.