By equal I expect you mean whether the two lists have the same values, you can use the Except operator and check whether the result has a count of zero (as pointed out by Tarun, you need to check whether both ways are the same ), something like this
List<string> one = new List<string>() { "a", "b", "c" };
List<string> two = new List<string>() { "a", "b", "c", "d" };
if (one.Except(two).Count() == 0 && two.Except(one).Count() == 0)
{
MessageBox.Show("They have same values");
}
else
{
MessageBox.Show("They are not same.");
}
if (one.Except(two, StringComparer.CurrentCultureIgnoreCase).Count() == 0 && two.Except(one, StringComparer.CurrentCultureIgnoreCase).Count() == 0)
{
MessageBox.Show("They have same values, igoring case");
}
else
{
MessageBox.Show("They are not same.");
}
if (one.Equals(two))
{
MessageBox.Show("They are the same reference");
}
else
{
MessageBox.Show("They are not same reference");
}
Hope this helps