Question: What's the fastest/least resource costing move when concatenating string together from things like datatables? For example:

```
     for (int i = 0; i < darray.Length; i++)
            {
                str_orderbycity += darray[i]["Sort_Order"].ToString() + ",";
                if (i < (darray.Length - 1))
                {
                    str_orderbycity += ",";
                }
            }

```

or waiting till the end and then running the remove method on the string:

```
      str_orderbycity = str_orderbycity.Remove(str_orderbycity.Length - 1, 1);

```

I'm just curious...

Thanks

Answer: 
A `StringBuilder` object, surely?

e.g.

```
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < darray.Length; i++)
        {
            sb.Append(darray[i]["Sort_Order"].ToString());
            sb.Append(",");
        }

        if (darray.Length > 0)
            sb.Remove(sb.Length - 1, 1);

```

It's sole function is to build strings. See [StringBuilder](http://msdn.microsoft.com/en-us/library/system.text.stringbuilder%28v=vs.110%29.aspx)

And, I believe, it's better to test once after the loop, and then remove.
Use string.Join:

string myStr = string.Join(",", myArray.Select(n => n.ToString()).ToArray())

Do a search on converting an array to csv for more info.