Is there an elegant way of converting this string array:
string[] a = new[] {\"name\", \"Fred\", \"colour\", \"green\", \"sport\", \"tennis\"};
How about this ?
var q = a.Zip(a.Skip(1), (Key, Value) => new { Key, Value }) .Where((pair,index) => index % 2 == 0) .ToDictionary(pair => pair.Key, pair => pair.Value);