hey, i have 2 listboxs (listbox1 and listbox2), both the listboxs contains output as following:
listbox1
1 2
1 4
1 5
1 2 4
2 4 5
listbox2
1 2 2 4 5
1 3 4 5
I wants to compare the 2 listboxs, for each line of listbox1, if listbox2 contains the number, then it will count the occurences by +1, for example:
for that 1 2 ,if it includes in the first line of listbox2 (1 2 2 4 5), then it will +1, after that it will look to line 2, if does not included, then i will continue to next line, and so on. finally i wants add to the sortedlist.
foreach (string sortComb in listbox1 .Items)
{
foreach (string ext in listbox2.Lines)
{
if (ext.Contains(sortComb))
{
// how to write the statement??
}
}
sortList2.Add(sortComb, ??);