append couple of strings into to string []

  • Thread starter Thread starter juli
  • Start date Start date
J

juli

How to append a couple of strings into a string[] in a loop? Thanks a
lot && good evening:)
 
Try using an arraylist

e.g:

ArrayList al = new ArrayList();

al.Add("string1");

al.Add("string2");

al.Add("string3");

al.Add("string4");

al.Add("string5");

string[] mystrings = (string[])al.ToArray(typeof(string));


Ciaran
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top