How does CONTAINS work in Conditional Statements with Variables

When using CONTAINS in Conditional Statements with Variables strings, does this function use exact matching (ex. Arrived) or a partial match (ex. Arrive)? I have a variable which is updated with one of several words like; Idle, Arrival, Arriving, & Arrived. I want my contains conditional to be true if any of the arrival words are used. So, will "Arriv" work? I've been looking around in the forum with limited time in the documentation area as well, but no luck to getting the question answered.

It uses contains(String str), which is a basic system string method -- but obviously, that doesn't answer your question. The test will find if there is any substring that matches the contains value. Here's an example with variables on both sides of contains:

For a question of this type, how does it work, my suggestion is to just play with it. Create some conditions in the Rule UI, and it will show you if they are TRUE or FALSE, or whatever value the conditions has, while showing the individual element values at the same time. It's harmless to play like this....


It's exactly as it says - if the target string contains the other string, it's true. It's not looking for words. It's just looking for one string in another.

So yes, arrived, arrival, arriving etc all contain arriv

Bear in mind it might be case sensitive.