I have List<string> myList
and List<string> myList1
objects: I would like
to compare them and if they are similar I want to pop up a messagebox, but when I click the button it shows nothing.
list<string> myList =new list<string>();
list<string> myList1 =new list<string>();
myList1.Add("a");
myList1.Add("r");
myList1.Add("u");
myList1.Add("y");
foreach (string str in listBox1.Items)
{
myList.Add(str);
}
if (myList==myList1)
{
MessageBox.Show("Matched");
}
else { MessageBox.Show("Not matched"); }