var strs = new string[] { "1", "3" }; var l1 = strs.ToLookup(a => "a"); //Key=a elements=1,3 var l2 = strs.ToLookup(a => "a" + a); //Key=a1 elements=1 Key=a3 elements=3 var d1 = strs.ToDictionary(a => "a" + a); //Key=a1 value=1 Key=a3 value=3
var strs = new string[] { "1", "3" }; var l1 = strs.ToLookup(a => "a"); //Key=a elements=1,3 var l2 = strs.ToLookup(a => "a" + a); //Key=a1 elements=1 Key=a3 elements=3 var d1 = strs.ToDictionary(a => "a" + a); //Key=a1 value=1 Key=a3 value=3