IEnumerable to string

前端 未结 7 2266
既然无缘
既然无缘 2021-02-04 23:55

I have a DataTable that returns

IDs
,1
,2
,3
,4
,5
,100
,101

I want to convert this to single string value, i.e:

,1,2,3,4,5,100         


        
7条回答
  •  不要未来只要你来
    2021-02-05 00:37

    Try this:

    var _values = _tbl.AsEnumerable().Select(x => x);
    string valueString = _values.ToList().Aggregate((a, b) => a + b);
    

提交回复
热议问题