Created
April 14, 2017 04:54
-
-
Save Cauterite/ed9ce498bc538fa15d4f805664bbc7f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
class Foo { | |
static void Main(string[] _) { | |
var xs = new[] {"apple", "passionfruit", "banana", "mango", "pear",}; | |
/* https://msdn.microsoft.com/en-us/library/9eekhta0 */ | |
var ys = xs | |
.Take(4) | |
.Select(x => x.ToUpper()) /* map */ | |
.Where(x => x.Length < 6) /* filter */ | |
.SelectMany(x => x) /* joiner */ | |
.Take(9); | |
System.Diagnostics.Trace.Assert( | |
ys.SequenceEqual("APPLEMANG")); | |
System.Console.WriteLine(ys.ToArray()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment