I have a Dictionary<string,string>
that I want to group. Here are some examples of key / value pairs
========================== | Key | Value | ========================== | A_FirstValue | 1 | | A_SecondValue | 2 | | B_FirstValue | 1 | | B_SecondValue | 2 | ==========================
Now I want to group it according to the first letter or word in the key before the first instance of the '_'
character
So, the end result will be Dictionary<string, Dictionary<string, string>>
. For the example above, the result will be:
A -> A_FirstValue, 1 A_SecondValue, 2 B -> B_FirstValue, 1 B_SecondValue, 2
Is it possible? Who could help me?
Thanks.
source share