Avatar of mhouldridge
mhouldridge

asked on 

Multidimensional ArrayList?

Experts,

I have various books that I'd like to store in an ArrayList.  I know how to add elements to an single dimension ArrayList, but not a multi-dimensional one.

Here's what I need

ArrayList books = new ArrayList();

// Add a new array row...

books.Add(BookAuthor[0], Bookname[1], booktitle[2]);

Is this the correct syntax?
            string BookAuthor = "Mark";
            string BookTitle = "SEO tips";
 
            ArrayList Books = new ArrayList();
            Books.Add({BookAuthor},{BookTitle});
 
 
            foreach (string Book in Books)
            {
                Console.WriteLine(Book.ToString());
            }
 
            Thread.Sleep(100000);

Open in new window

C#

Avatar of undefined
Last Comment
techpr0

8/22/2022 - Mon