Search code examples
c#arraystypesmixed

Data Custom Array Groupping C#


I've been struggling to group some data into an array of this format:

http://pastebin.com/dxkCnzq3

In case your confused it would be something like this (number of type)

 new Array[Bool(2)][Bool(2)][Byte(3)][String(X)]

Where the number of strings is dynamic, and the else are fixed.

Is there any way to achieve this in c#?

Any help appreciated


Solution

  • It kind of sounds that you could use a Tuple

    var dict = new Dictionary<Tuple<bool, bool, bool, bool, int, int, int>, string[]>();
    dict[Tuple.Create(true, true, false, false, 2, 3, 5)] = new[] { "test", "pest" };