1. 程式人生 > >【Linq】相關疑惑

【Linq】相關疑惑

string lookup col nts class code element linq ict

            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

【Linq】相關疑惑