var strings = new List<string> { "blah", "de", "hoo", "ha" };
var result = strings.Aggregate((i, j) => i + " " + j);
Console.Write(result);
And with a complex type, where a response has a collection of messages, each with a text property:
var messages = this.Response
.Messages
.Select(m => m.Text)
.Aggregate((i, j) => i + " " + j);
No comments:
Post a Comment