The Message text: |
Hi!,
This email was created by [MemberName] <[MemberEmail]> who thought you would be interested in the following Article:
"Converting Array or List of data to String => made easy! (C#, MVC3, LINQ)" I would just use:string.Join(",", cities.Select(c=>c.Name))Since Version 4 of the Framework there is an overloaded versions of string.Join for IEnumerable too. It uses a StringBuilder internally and doesn't insert a seperator after the last element as well.I could't find the Join method...
CodeProject also contains hundreds of articles, free source code samples and applications to help in your day to day programming. Why not give it a try! |