then I have my second string variable 2 that looks like:
F, E, D
What I need is:
I use variable 1 as a kind of a list and if all elements of variable 2 are contained in the list (variable 2 is always fixed) then its fine but I need to log an error when they are not so for example:
1st example:
variable 1 = A, B, C, D, E, F, G
variable 2 = F, E, D
output: none (as all elements of variable 2 are contained in variable 1.
2nd example:
variable 1 = A, B, C, D, F, G (E is missing)
variable 2 = F, E, D
Assign variable1List = variable1.Split({","}, StringSplitOptions.RemoveEmptyEntries).Select(Function(x) x.Trim()).ToList()
Assign variable2List = variable2.Split({","}, StringSplitOptions.RemoveEmptyEntries).Select(Function(x) x.Trim()).ToList()
Assign missingElements = New List(Of String)
For Each element In variable2List
If Not variable1List.Contains(element) Then
missingElements.Add(element)
End If
Next
If missingElements.Count = 0
Log Message: "None (as all elements of variable 2 are contained in variable 1)"
Else
Log Message: String.Join(", ", missingElements) & " is/are missing from the list"
End If