These are excellent examples of using the contains function with a âsingleâ search term, like ârainâ or âclearâ. I can easily do this with each keyword, but when I have multiple search terms, like ârainâ, âthunderâ, âsnowâ, âhailâ, âshowerâ, âlightningâ and multiple searchStrings⌠the number of times I need to construct a single statement and handle the problem of setting the boolean variable to True but then not back to False on the next statement is challenging. I can also chain separate @if statements within an expression block of â|â so obtain a True or False (See below Example 2), but this is messy at best in the limited editing area of the expressions GUI editor.
@michicago, Iâm not saying that I cannot do this the hard way, but the original question was why canât the contains function allow using a text string list array of search terms separated by commaâs and brackets to be used as an argument to searching the search string (Example 1)?
Example 1
arrayList[] = ["one","two",three","four","five"]
string searchString = "The Rain in Spain Falls Mainly on the plain at three o'clock"
contains(searchString, arrayList)
rather than:
Example 2
string searchString = "The Rain in Spain Falls Mainly on the plain at three o'clock"
contains(searchString, "one") | contains(searchString, "two") | contains(searchString, "three") | contains(searchString, "four") | contains(searchString, "five")