Assigning values from list to list excluding nulls
- by GutierrezDev
Hi.
Sorry for the title but I don't know other way of asking.
I got 2 Dictionary < string,string list
One of them has a length of 606 items including null values.
The other one has a length of 285 items.
I determined the length doing this:
int count = 0;
for (int i = 0; i < temp.Length; i++)
{
if (temp[i] != null)
count++;
}
Now I want to assign every value in the temp variable to another variable excluding the null values.
Any Idea?
Remember that I have a different size variables.
Edited
Dictionary<string, string>[] info;
Dictionary<string, string>[] temp = new Dictionary<string, string>[ds.Tables[0].Rows.Count];
....
Here I added some data to the Temp variable
.....
Then this:
int count = 0
for (int i = 0; i < temp.Length; i++)
{
if (temp[i] != null)
count++;
}
info = new Dictionary<string, string>[count];
Hope you understand now.