Steveluo’s Blog

Just another WordPress.com weblog

Linq (3)

Posted by steveluo on August 19, 2009

I posted the question and get an answer
Hi I get the followwing direcories by calling GetDirectories()

c:\app\20090331\
c:\app\20090430\
c:\app\20090531\
c:\app\20090630\
c:\app\20090731\
c:\app\20090831\

I want to the directories between 20090531 and 20090731, How can I do it by Linq?
the answer is
var query = directories .Where(x => { return (String.Compare(x, @”c:\app\20090531″) > 0 && String.Compare(x, @”c:\app\20090731″) < 0) ;});

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: