Source code quote in C#n° 235
April 23, 2016 am30 10:16
private List<string> GetStringElements(List<Tuple<string, int>> input)
{
//From this list of input tuples, return a list which contains only the string component.
Tuple<List<string>, List<int>> newT = input.Aggregate(Tuple.Create(new List<string>(input.Count),
new List<int>(input.Count)), (unpacked, tuple) => { unpacked.Item1.Add(tuple.Item1);
unpacked.Item2.Add(tuple.Item2); return unpacked;});
return newT.Item1;
}