Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Better way to search array for elements in other array?

by Limbic~Region (Chancellor)
on Jan 24, 2011 at 21:49 UTC ( [id://884009]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://884009]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2026-01-25 02:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (126 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.