Microsoft Technology, .Net, BizTalk, Sharepoint & etc.

Liedong(Ken) Zheng, Senior SharePoint Developer at SIMPLOT

Convert String[] to String

Posted by ken zheng on May 28, 2008

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

// First Convert the long array to string arrayString[] 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 );

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>