Sunday, April 26, 2020

How to convert int array to string like convert int[] array = {1,2,3,4,5}; to string without loop in c# .net

Question  :- convert int[] array = {1,2,3,4,5}; to string without loop?
Like //output  = "1,2,3,4,5"

Answer :- string ids = String.Join(",", array.Select(p=>p.ToString()).ToArray());