Is there an elegant way of converting this string array:
string[] a = new[] {\"name\", \"Fred\", \"colour\", \"green\", \"sport\", \"tennis\"};
a.Select((input, index) = >new {index}) .Where(x=>x.index%2!=0) .ToDictionary(x => a[x.index], x => a[x.index+1])
I would recommend using a for loop but I have answered as requested by you.. This is by no means neater/cleaner..