i'm new in c# ,sorry for bad question.
how can i say, if an item in a list,
exists in another list?
l know it can be done using linq functions, but I don't know which method can help.
I want something like this:
bool Exists(List<int> list1, List<int> list2)
{
// if the value of the first index of list1 exists in list2, return true.
}
well
you can do this
bool Exists(List<int> list1, List<int> list2)
{
var firstIndex=list1.First();
return list2.Any(num=> num == firstIndex);
}