How do I put the contents of a list in a single MessageBox?

前端 未结 5 1178
陌清茗
陌清茗 2020-12-28 20:19

Basically, I have a list with multiple items in it and I want a single message box to display them all.

The closest I have got is a message box for each item (using

5条回答
  •  忘掉有多难
    2020-12-28 20:46

    If you have .Net 4.0

    string s = String.Join(",", list);
    

    If you don't but have 3.5

    string s = String.Join(",", list.ToArray());
    

提交回复
热议问题