日期:2014-05-18 浏览次数:20828 次
var list=new List<string>{"中山一路|42","中山二路|34","五山路|35","五山路|56"}; var result=list.GroupBy(l=>l.Split('|')[0]) .Select(g=>g.Key+"|"+g.Sum(m=>int.Parse(m.Split('|')[1]))) .ToList();