LINQ: How do I concatenate a list of integers into comma delimited string?

前端 未结 4 1438
鱼传尺愫
鱼传尺愫 2021-02-01 13:51

It\'s probably something silly I missed, but I try to concatenate a list of integers instead of summing them with:

integerArray.Aggregate((accumulator, piece) =&         


        
4条回答
  •  臣服心动
    2021-02-01 14:13

    Just to add another alternative to @Marc's

    var list = string.Join( ",", integerArray.Select( i => i.ToString() ).ToArray() );
    

提交回复
热议问题