How do I create a comma delimited string from an ArrayList?

前端 未结 6 2266
野的像风
野的像风 2020-12-12 23:15

I\'m storing an ArrayList of Ids in a processing script that I want to spit out as a comma delimited list for output to the debug log. Is there a way I can get this easily w

6条回答
  •  有刺的猬
    2020-12-12 23:56

    Something like:

    String.Join(",", myArrayList.toArray(string.GetType()) );
    

    Which basically loops ya know...

    EDIT

    how about:

    string.Join(",", Array.ConvertAll(a.ToArray(), Convert.ToString));
    

提交回复
热议问题