Remove Odd items from Array

Is there a way to remove the items in array who’s positions in the array are even? For example item(0), Item (2), Item(4) and so on.

Hi,

Hope the following helps you.

Remove even:

arrVar = arrVar.Where(Function(x,i) i mod 2 =1).ToArray()

Remove odd:

arrVar = arrVar.Where(Function(x,i) i mod 2 =0).ToArray()

Regards,

1 Like

Amazing thank you so much!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.