Citation de code source en C#n° 235
23 April 2016 à 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;
}