c# Add to elements of a string array

  • Thread starter Thread starter Colin Williams
  • Start date Start date
C

Colin Williams

Hi
I have a file list box with which i am passing the selected items to a
string array (using copyTo), however i also need to pass the path of
the FLB with each string in the array. Is it possible to add this to
each element of the array or is there another approach i could take.

Thanks


Colin Williams
 
btw
Here is the code so far.

int iCount = 0;

iCount = flbsource.SelectedItems.Count;
string spath = flbsource.Path + "\\";

String[] source = new String[iCount];

flbsource.SelectedItems.CopyTo(source, 0);
 
Colin Williams said:
Hi
I have a file list box with which i am passing the selected items to a
string array (using copyTo), however i also need to pass the path of
the FLB with each string in the array. Is it possible to add this to
each element of the array or is there another approach i could take.

Why don't you add the Items manually to the array (btw: why don't you take
an ArrayList?)?
E.g. with foreach..
 

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