StringCollection[]

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

Hi,

Is it possible to iterate through a StringCollection[] ? I have the
following code but "row" always seems to contain the values of rowValues2

Thanks for any input,

Danny





StringCollection[] scArray = new StringCollection[]{rowValues1, rowValues2};



foreach (StringCollection row in scArray) //Does not seem to work for a
StringCollection[]

{



}
 
Dan said:
Is it possible to iterate through a StringCollection[] ? I have the
following code but "row" always seems to contain the values of rowValues2

That suggests that you've made an error in the rest of your code.

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
 
Hi Dan,

Try this code:

foreach (StringCollection row in scArray)
{
foreach(string str in row)
MessageBox.Show (str);
}



Regards,
Peter
 

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