CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Location
    G day Mayt Land
    Posts
    971

    [RESOLVED] String Array (2D) dynamic

    If one was to work with an 1-D of string []
    Code:
     string[] strLine1;
     strLine1 = Get(); // this returns a list if strings
    ...
    ..
    
     private string[] Get()
     {
       List<string> List = new List<string>();
     // do something
       return List.ToArray();
     }
    Question is this :

    What happens if we were to hold multiple of strLines ?

    what does a 2D array of string looks like?
    // can something liek this be done in c#?

    Code:
     string[,] strLine1;
    
    while(until something is not happening)
    {
    	strLine1[i++] = Get(blala blaa);
    }

  2. #2
    Join Date
    Jul 2006
    Posts
    297

    Re: String Array (2D) dynamic

    Check out this link, maybe it will help a little. In particular the part at the bottom.

    http://msdn.microsoft.com/en-us/libr...53(VS.71).aspx

  3. #3
    Join Date
    May 1999
    Location
    G day Mayt Land
    Posts
    971

    Post Re: String Array (2D) dynamic

    Code:
                        ArrayList TotalList = new ArrayList();
                       string [] list;
                        foreach (string sheet in sheets)
                        {
                            list = FetchXLS(blaaa blaaa);
                            TotalList.Add(list);
                        }
    ArrayList did the job. Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured