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

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Socket.connect doesn't throw exception in Android -

SPSS keyboard combination alters encoding -