recursiveContradiction recursiveContradiction - 28 days ago 7
C# Question

Need a two dimensional [string][int] array to store DateTimes

I can not find anywhere a two dimensional [string][int] array which could assign many

DateTime
for a string.

Example:

Array["Branch"].Add(Date);

Answer

Sounds like you want to use a dictionary of Lists, like so

var dict = new Dictionary<string,List<DateTime>>();

then you add lists for a string like so:

dict["Branch"] = new List<DateTime>();

and add dates like so:

dict["Branch"].Add(Date);
Comments