Add new item in existing array in c#.net Ask Question

Add new item in existing array in c#.net Ask Question

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

I need to preserve the existing data.

ベストアンサー1

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

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

おすすめ記事