Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Best method to eliminate substrings from array

by AnomalousMonk (Archbishop)
on Jun 26, 2019 at 17:13 UTC ( [id://11101962]=note: print w/replies, xml ) Need Help??


in reply to Best method to eliminate substrings from array

Each string is a set of two or more values separated by pipes ("|"). ... eliminate any strings that are substrings of other strings ...

What's a "value"? Can you have a string 'AA|BB|CC? If so, is 'A|B' a valid substring of it? (This would be true if testing with index.) Basically, I don't understand the concept of "substring."


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^2: Best method to eliminate substrings from array
by catemp (Initiate) on Jun 26, 2019 at 17:23 UTC
    The values are actually part numbers so they might be something like 124182 or 3718317. The strings are lists of parts that are related to each other and when I generate the lists I might get a string of five parts and then another string containing those same five parts plus one more. I would want to only keep the string with the six parts because the five part string is essentially a substring of the six part string. Instead of substring you could say subset.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2024-04-23 07:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found