Pouvez-vous me aider à comprendre,Besoin de précisions sur la fonction Enumerable.Aggregate
words.Aggregate((workingSentence, next) => + next + " " + workingSentence);
en bas extrait de code? et ce serait génial si quelqu'un m'expliquait cela en C# 1.1.
(Snippet De MS) -
string sentence = "the quick brown fox jumps over the lazy dog";
// Split the string into individual words.
string[] words = sentence.Split(' ');
// Prepend each word to the beginning of the
// new sentence to reverse the word order.
string reversed = words.Aggregate((workingSentence, next) =>
next + " " + workingSentence);
Console.WriteLine(reversed);
// This code produces the following output:
//
// dog lazy the over jumps fox brown quick the
Merci et clair pour moi, je vais essayer quelques autres exemples basés sur cela. Merci aussi à Gabe et Will. – paragy