String contains multiple words

Hi is it possible to get the string.contains node to search if any of the words in a string are present in the list other list.

I think its something like this but the lacing gets to out of control for me. Also the search terms could only be one word sometimes.

It looks like you’re checking the same words and phrases repeatedly in a cross lacing arrangement. If you are planning to cross lace, perhaps split the list by " " separators and then reduce the list down to unique strings? In your screenshot the only three search terms you actually need are “ENLARGED”, “FLOOR”, AND “STRUCTURAL”.

opps didnt post the pic of what I was working on but added string split but got to confusing for me. Unique strings is a great idea thanks! It’s unlikely but someone may create an OVERALL FLOOR only with nothing else.

trying your idea

the temp fix ive done for now. But would be good to have a way to isolate and search for each word encase people used a different term

@vanman Try something like this:

or

2 Likes

Not related, but odd behavior in the preview window: the string “List” apparently confuses the display. Data seems to be intact, though.

Thanks, thats some good ideas for me to go off. One things that’s important is the beginning search string list amount stays the same number in the get item at index to put any template it does find to the correct view

Why do you have duplicates of search strings in your list? Would be much faster to get the unique items and only search those once. Then you can use mask your search results with the original list.

Hi Nick, comes down to user input. I made a script that creates floor plans from levels. Someone can say there will be 4 parts of the floor plan and then itll create duplicates later on. LEVEL 0 ENLARGED FLOOR PLAN PART A etc. Not sure if this makes sense. But then you’ve got a bunch of floor plans you want to assign a template to if they use the word FIRE or FINISHES or CEILING ya know. But they might say OVERALL FIRE or some other terminology

Makes sense. You still probably don’t need all the duplicates at this step but if it helps you keep track of everything then it’s worth keeping. Get rid of String.Split and change the list level of the searchFor input to @L1. I’d also maybe suggest using List.ByBoolMask over List.GetItemAtIndex, but I think both will work.

1 Like