Quantcast
Channel: coder i|o: #strings
Viewing all articles
Browse latest Browse all 138

Converting Array or List of data to String => made easy! (C#, MVC3, LINQ)

$
0
0

From CodeProject:

If you're stuck with .NET 3.5, you can use the Aggregate extension method[^]:string cities_string = cities.Aggregate(new StringBuilder(), (sb, c) =>{ if (0 != sb.Length) sb.Append(", "); sb.Append(c.Name); return sb;}, sb => sb.ToString())

Click here to read more

Tagged: #c #linq #mvc #strings


Viewing all articles
Browse latest Browse all 138

Trending Articles