hi please help me
string [] s = new string []{1 , 2 , 3 };
string [] e = new string [] {1 , 2 ,4};
the output what I want are : 1 2 3 4
hi please help me
string [] s = new string []{1 , 2 , 3 };
string [] e = new string [] {1 , 2 ,4};
the output what I want are : 1 2 3 4
You are declaring a string[]
, however your values are int
. You must either use string
values or change the type of your array
to int
.
Union
of IEnumerable
is the function you're looking for and it does everything for you.
int [] s = new int [] {1, 2, 3};
int [] e = new int [] {1, 2, 4};
int[] union = s.Union(e).ToArray();