Join Arrays in Vb. Net [Duplicate]
What's the Simplest Way to Join One or More Arrays (Or Arraylists) in Visual Basic? I'm Using. Net 3.5, If That Matters Much. 0 1 Answer This Is in C#, but...
What's the simplest way to join one or more arrays (or ArrayLists) in Visual Basic?
I'm using .NET 3.5, if that matters much.
This is in C#, but surely you can figure it out...
int[] a = new int[] { 1, 2, 3, 4, 5 };
int[] b = new int[] { 6, 7, 8, 9, 10 };
int[] c = a.Union(b).ToArray();
It will be more efficient if instead of calling "ToArray" after the union, if you use the IEnumerable given instead.
int[] a = new int[] { 1, 2, 3, 4, 5 };
int[] b = new int[] { 6, 7, 8, 9, 10 };
IEnumerable<int> c = a.Union(b);