How to concatenate array of integers into comma separated string

前端 未结 4 1044
陌清茗
陌清茗 2021-01-22 01:55

I have two question, acually:

  1. How to join array of integers into comma separated string? (1,2,3) => \"1,2,3\"
  2. How to convert array of integers t
4条回答
  •  难免孤独
    2021-01-22 02:46

    This worked for me:

    [String]::Join(",", $arraylist.ToArray())
    

    I got 1,2.

    And then the second part:

    foreach($number in $arraylist) { $number.ToString() }
    

提交回复
热议问题