Sunday, September 22, 2013

Sentence reversal in msdn

var sentence = "the quick brown fox jumped over the lazy dog";
var words = sentence.split(' ');

var reversedSentence  = words.Aggregate((sent, next) =>  next + " " + sent);

Console.WriteLine(reversedSentence);

No comments:

Post a Comment