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

后端 未结 11 817
广开言路
广开言路 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:42

    ints.Aggregate("", ( str, n ) => str +","+ n ).Substring(1);
    

    I also thought there was a simpler way. Don't know about performance, anyone has any (theoretical) idea?

提交回复
热议问题