C
C#3y ago
N0mlss

❔ How can I check if any element of a list is in another list?

I know i could do it with a for loop, but it seems overkill to do something that simple :/
4 Replies
Angius
Angius3y ago
list1.Any(x => list2.Contains(x))
list1.Any(x => list2.Contains(x))
N0mlss
N0mlssOP3y ago
Worked like a charm! Thanks a lot!
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server