I've two lists like this:
a1, a2, a3, ..
and
b1, b2, b3, ..
How can I mix them to have a result like this?:
a1, b1, a2, b2, ..
I thought of this, but I don't like it:
for (int i = 0; i < List1.Count; i++)
{
FinalList.Add(List1[i]));
if (i < List2.Count)
FinalList.Add(List2[i]));
}
if (List1.Count < List2.Count)
{
for (int i = List1.Count; i < List2.Count; i++)
{
FinalList.Add(List2[i]);
}
}