string str = "";
// loop though an array and create a string
// delimited with commas
foreach (string s in fieldNames)
{
str += s;
// if this not the last item in the array
// append a comma to end of the string.
if (s != fieldNames[fieldNames.Length - 1])
{
str += ", ";
}
}
Merging a String Array to a Comma delimited String (foreach)
Leave a Reply
You must be logged in to post a comment.