@zeido To test for existence, you must first identify the characteristics of the ad, ANYTHING.
If you don't identify the ad, you can't work with it.
Check if ANY word in an array is contained in a string?
-
I have an array with data like "Bob, Amy, James" etc..
I need a working IF statement to check if ANY of the words in an array are contained in a string, and also included partial matches. Meaning if a string = "hellobob123" it would still be true because it contains "bob"
I'm still new to JS so not sure how I would go about this..
Alternatively, I can use a text file instead of an array, but each word would be on a different line. I don't mind using this option either, but it needs to check every word in the text file (or array) for a partial match in [[VARIABLE]]
Please help, thanks
-
@spockthe40oz said in Check if ANY word in an array is contained in a string?:
I have an array with data like "Bob, Amy, James" etc..
I need a working IF statement to check if ANY of the words in an array are contained in a string, and also included partial matches. Meaning if a string = "hellobob123" it would still be true because it contains "bob"
I'm still new to JS so not sure how I would go about this..
Alternatively, I can use a text file instead of an array, but each word would be on a different line. I don't mind using this option either, but it needs to check every word in the text file (or array) for a partial match in [[VARIABLE]]
Please help, thanks
This can only be done by iterating through the elements, use the "foreach" action.
