Skip to content

Instantly share code, notes, and snippets.

@booyaa
Created April 4, 2012 15:20
Show Gist options
  • Save booyaa/2302601 to your computer and use it in GitHub Desktop.
Save booyaa/2302601 to your computer and use it in GitHub Desktop.
Querying text files in LINQ
void Main()
{
IEnumerable<string> textFile = File.ReadLines(@"C:\leet\users.txt");
var matches = from word in textFile
where word.Substring(0,2) == "FU"
select word;
matches.Dump();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment