Check multiple keywords in 2 string varables


Data - str_one and str_two

Multiple Strings - “Not working”, “Receiving error”, “is down”, “got locked”, “locked”, “Reset password”, “Password”, “getting error", “Error”, “Facing issue”, “Cannot access”, “Connection lost”, “Lost connection”, “Broke”,“Broken”, “Unable to access”, “Please unlock”, “Can’t access”, “Not able to access”, “Create Incident”, “Create an Incident”, “Open Incident”, “Open an Incident”, “Can’t receive”, “Cannot receive”, “Unable to receive”, “Not receiving”, “Unable to”, “keeps crashing”, “Crashed”, “Issue”, “Not loading”, “Unable to load”, “Cannot load”, “Can’t load”, “Not launching”, “Unable to launch”, “Cannot launch”, “Can’t launch”, “Problem”, “Unable to”, “Expired”, “Password expired”, “Server offline”, “Server is offline”, “Vanished”, “Session ended”, “Connection ended”, “Remote ended”

Requirement - I want to check that whether str_one or str_two consists of multiple strings on the basis of which i need to perform certain actions ?
How can i do this ?

note - I DO NOT wish to perform standard method ie str_one.contains(“X”) or str_two.contains(“Y”) then perform Action

1 Like


you can check like thsi

Multiplestr.Splt({","},StringSPlitOptions.None).Contains(str_One) Or Multiplestr.Splt({","},StringSPlitOptions.None).Contains(str_two)

Thsi will check all the strings in Multiplestr variable …Splitting on comma assuming that each word is separated by comma

You can aswell try this

Multiplestr.Splt({","},StringSPlitOptions.None).Any(fucntion(x) x.Contains(str_One) Or x.Contains(str_Two))


Hi @prerna.gupta ,

Assuming the multiple strings are already stored in an Array, we could perform the Check using the below Expression :


If the condition is any one of the strings need to consists of all the values present in Multiple string array, then you could combine with orElse :

MultipleStringsToCheck.All(Function(x)str_one.Contains(x)) OrElse MultipleStringsToCheck.All(Function(x)str_two.Contains(x))

Here, MultipleStringsToCheck is a variable of type Array of String which contains all the strings to check.

1 Like

Thanks for suggestion but facing below error :


If the data is already in an array you need not split again…

The assumption of using split was that the multiplestr is of type string…

If it is already of type array of strings then directly use the any function removing the split part

Multiplestr.Any(fucntion(x) x.Contains(str_One) Or x.Contains(str_Two))


In above eg all keywords are stored in str_InputArray

@prerna.gupta ,

Was a test done using the expression provided in the above post ? Sending feedbacks on the different suggestions provided would also help us in understanding the exact requirements faster. :slight_smile:

@prerna.gupta I guess the issue is because of misspelled word function. It should be function but in your expression it was fucntion. Use the below one

str_InputArray.Any(Function(x) x.Contains(str_One) OR x.Contains(str_Two))
1 Like


in the given one there is a typo in function, Please try this

Multiplestr.Any(function(x) x.Contains(str_One) Or x.Contains(str_Two))


A few code snippets, maybe it can help

Sample Series 1:
we create an Array of our test strings and check it against our String array with Values:
Last intersect returns us the common values bettween the both arrays

Series 2
We do see that it is case-sensitive but harmonize it:
so now also the Not Responding vs. not Responding is covered

as arrCheckValue can have any length, we can avoid the concatenated OR/AND checks

Requirement is any of the two string ie str_one or str_two consists ANY of multiple keyword


Did you happen to try the updated formula?

facing any issues?


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.