© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
7 replies
Raki

✅ How to check whether a given list is present in the List of list

I have a List<List<int>> candidates and before adding into it want to check whether a list is already present. The condition is true all the time. How to implement the check condition for each addition

var temp = new List<int>(tempList);
if(!candidates.Any(x => x == temp))
{
candidates.Add(temp);
}
var temp = new List<int>(tempList);
if(!candidates.Any(x => x == temp))
{
candidates.Add(temp);
}
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Check whether list of generics contains a type, that implements interface
C#CC# / help
2y ago
The Given key was not present in the dictionary
C#CC# / help
16mo ago
❔ How can I check if any element of a list is in another list?
C#CC# / help
4y ago
How to determine whether the NuGetPackageId of RuntimeCopyLocalItems is in _ExcludePackage in Condit
C#CC# / help
6mo ago