Linq to check if each value in array is present in the list of string

Hi,

Linq to check if each value in array called arrayA is present in the list of string called listA.

If a single item in arrayA is not present in list A,
Then set flag to True and output the items of arrayA not available in listA

Is this possible?

Thanks!

Hi @Ray_Sha1

Try this

image

Refer the xaml

LINQ_Except.xaml (5.5 KB)

1 Like

grafik

Set Operator Except is deduplicating
Where filter Approach keeps the duplicate

As it is LINQ with underlying IEnumerable code will work for lists as well

Then set flag to True

can be derived from the output.Length > 0

2 Likes

Hey @ppr @kumar.varun2,

Both the solution work.

@ppr , I need non duplicated values, so using except.

Thanks both of you!

perfect. Then hint was about the risk of fail and not about the need. But if no duplicates are to expect we would recommend the Except approach from Varun

1 Like

image

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