in reply to Re: Better way to search array for elements in other array?
in thread Better way to search array for elements in other array?

SuicideJunkie,
Explain to me how that is going to efficiently tell me that:
"Have a Merry Christmas and a Happy New Year" contains "and"

The trouble is that it can appear anywhere in the string so you either need to build the data structure for every starting point in the string or repeat the test for as many characters as are in the string (unless I am missing something).

Cheers - L~R

Replies are listed 'Best First'.
Re^3: Better way to search array for elements in other array?
by SuicideJunkie (Vicar) on Jan 25, 2011 at 16:16 UTC

    I was under the impression that the array elements were entire strings... that the search was for stuff in the other array, rather than for stuff inside the strings in the other array.

    Given that, you're right that it is solving a completely different problem.