Convert an array to string

前端 未结 3 376
悲哀的现实
悲哀的现实 2020-12-13 11:43

How do I make this output to a string?

List Client = new List();
foreach (string listitem in lbClients.SelectedItems)
{
    Clien         


        
3条回答
  •  甜味超标
    2020-12-13 12:19

    My suggestion:

    using System.Linq;
    
    string myStringOutput = String.Join(",", myArray.Select(p => p.ToString()).ToArray());
    

    reference: https://coderwall.com/p/oea7uq/convert-simple-int-array-to-string-c

提交回复
热议问题