I couldn't find this anywhere else. I've an array of lists:
public List<xmldata>[] XMLArrayList = new List<xmldata>[9999];
To initialize and insert a list into each position, i do the following:
for(int m=0; m< XList.XMLArrayList.Count(); m++)
{
XList.XMLArrayList[m] = new List<xmldata>();
}
But i would like to count how many elements there aren't null. EX: Positions 0 to 5 have a List on them. But other positions not.
Tried a linq approach:
int count = XList.XMLArrayList.Count(x => x != null);
But it returns me the array size (9999). How can i count the non null elements on an array of lists ? Ps: Already tried Dictionary and And List of List - this approach works best for achieving what i need.
Thanks.