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.