January 2012
Intermediate to advanced
396 pages
8h 16m
English
Follow the given steps:
string sentence = ".NET Generics is a great API";
sentence.Split('').Reverse().ToList().ForEach(c=>Console.Write(c+""));
sentence.Split(' ') generates a string[], and Reverse() returns an IEnumerable<string> with a reversed order of the words. Now I can convert this back to a List<string> to use the ForEach() method as it was used earlier.
Read now
Unlock full access