Created
April 4, 2012 15:20
-
-
Save booyaa/2302601 to your computer and use it in GitHub Desktop.
Querying text files in LINQ
This file contains hidden or 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
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