I am trying to take an arbitrary-length String[] and print it out to a String, preferably with field separators. Right now I have:
String[] start = {"first", "second", "third"}; //[] to convert
String cC = "";
String finish = ""; // Final String
String cC1 = "";
{
for (int i = 0; i < puts.length; i++) {
cC = puts[i] + ", ";
cC1 = (finish + cC);
finish = cC1;
}
}
But for some reason it is only returning the "second" value. How can I make it properly concatenate the values?
Also, could I simplify the code by using finish += cC
? Thanks.