public string[] GetMissingItems(string[] allItems, string[] someItems)
{
ArrayList missingItems = new ArrayList();
for (int i=0; i<allItems.Length; i++)
{
bool match = false;
if ( allItems[i].Trim().Length > 0 ) //filter out empty strings
{
for (int j=0; j<someItems.Length; j++)
{
if ( someItems[j].Trim().Equals(allItems[i].Trim()) )
{
match = true;
}
}
if (!match)
{
missingItems.Add(allItems[i]);
}
}
}
string[] aMissingItems = new string[missingItems.Count];
missingItems.CopyTo(aMissingItems);
return aMissingItems;
}
|