String.Join. This method can take a string array and a separator and then return that as a single string.

                    String author;
                    if (object.ReferenceEquals(da[“Author”].GetType(), typeof(String[])))
                    {
                        author = String.Join(” “, (String[])da[“Author”]);
                    }
                    else
                    {
                        author = da[“Author”].ToString();
                    }

or

// First Convert the long array to string array

String[] strArray = Array.ConvertAll<long, string>(lngArray, new Converter<long, string>(delegate(long lNum) {return lNum.ToString();}));

 

// Now use the String.Join to get a comma seperated list of the array’s items

string strArrayList = String.Join(“,”, strArray );

Advertisements