I would like to output all objects in an array of strings for which the length is variable.
example 1 :
string id = A;
string [] values = new string [] {"12","23"};
string output = string.Format("{0}, {1}, id, values);
//output should be "A,12,23"
example 2 :
string id = A;
string [] values = new string [] {"12","23","45","67","89"};
string output = string.Format("{0}, {1}, id, values);
//output should be "A,12,23,45,67,89"
Is there any way which would cover any number of values or do I need to convert the values into a String and then output it?
string.Jointhat you can try... They are present in C# >= 4.0 and they work with arrays andIEnumerable<>