Add new item in existing array in c#.net

Nirmal picture Nirmal · Oct 30, 2008 · Viewed 462k times · Source

How to add new item in existing string array in C#.net?

I need to preserve the existing data.

Answer

Ed S. picture Ed S. · Oct 30, 2008

I would use a List if you need a dynamically sized array:

List<string> ls = new List<string>();
ls.Add("Hello");