How about a
List<List<T>>
? :)
I guess having a list of lists is more or less the same as having a two-dimensional array.
List<T>[][]
is also perfectly valid, although you'd get a lot of lists.
List<List<string>> lists = new List<List<string>>();
lists[0].Add("Hello");
string test = lists[0][0];
Edit:
So about the
Dictionary<TKey, TValue>[
^] option, you could have a
Dictionary
inside a
Dictionary
.
You say you have a day, so let's say day 1, day 2, day 3... In this case a day is an
integer
value.
For any given day you have a time, perhaps you are using
TimeSpan[
^] for this.
Also, my guess is that for every day-time combination you want to store a value, let's say a
string
(but it could be anything). You would then have a
Dictionary
like this:
Dictionary<int, Dictionary<TimeSpan, string>>
string myString = myDictionary[1][myTime]
Let's say your day is a specific date. Your
Dictionary
would then look like:
Dictionary<DateTime, Dictionary<TimeSpan, string>>
string myString = myDictionary[DateTime.Today][myTime]
Usage is pretty easy compared to working with a multidimensional array I think (but that's just a matter of what you're accustomed to) :)