How to join int[] to a character separated string in .NET?

后端 未结 11 833
广开言路
广开言路 2020-11-29 19:17

I have an array of integers:

int[] number = new int[] { 2,3,6,7 };

What is the easiest way of converting these into a single string where

11条回答
  •  时光说笑
    2020-11-29 19:52

    You can do

    ints.ToString(",")
    ints.ToString("|")
    ints.ToString(":")
    

    Check out

    Separator Delimited ToString for Array, List, Dictionary, Generic IEnumerable

提交回复
热议问题