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")