Hi everyone,
I have two lists,
L1={A,B,C,D}
L2={A,B,C,D,E,F}
We need to check whether L1 values are available in L2 without using ‘for each’ loop, and the result should be a Boolean variable.
Can anyone suggest a LINQ query?
Thank you.
Hi everyone,
I have two lists,
L1={A,B,C,D}
L2={A,B,C,D,E,F}
We need to check whether L1 values are available in L2 without using ‘for each’ loop, and the result should be a Boolean variable.
Can anyone suggest a LINQ query?
Thank you.
Use this LINQ
allContained = L1.All(Function(item) L2.Contains(item))
Here, allContained
is a Boolean
variable that will be True
if all elements in L1
are present in L2
and False
otherwise.
Input:
L1 = New List(Of String) From {"A", "B", "C", "D"}
L2 = New List(Of String) From {"A", "B", "C", "D", "E", "F"}
Logic:
Output:
Sample Workflow:
Workflow1.xaml (7.5 KB)
Thanks,
Ashok
Thank you so much…
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.