What's the best way to add an item to a C# array? -


i have following array:

int[] numbers; 

is there way add number array? didn't find extension method concats 2 arrays, wanted like:

numbers = numbers.concat(new[] { valuetoadd }); 

to concatenate 2 ararys at: how concatenate 2 arrays in c#?

the best solution can suggest use

list<int> numbers 

and when needed call toarray() extension method (and not opposite).


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -