Skip to content

Instantly share code, notes, and snippets.

@andresriancho
Created February 20, 2017 20:22
Show Gist options
  • Save andresriancho/42f36c671c8bc30f42196ddb939645e9 to your computer and use it in GitHub Desktop.
Save andresriancho/42f36c671c8bc30f42196ddb939645e9 to your computer and use it in GitHub Desktop.
linq-example.cs
using System;
using System.Linq;
using System.Collections.Generic;
class app {
static void Main() {
string[] names = { "Burke", "Connor", "Frank",
"Everett", "Albert", "George",
"Harris", "David" };
IEnumerable<string> query = from s in names
where s.Length == 5
orderby s
select s.ToUpper();
foreach (string item in query)
Console.WriteLine(item);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment