TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
dc
NA
663
0
C# using linq statement
May 7 2013 2:40 PM
For code that is wruitten as C# 2008 desktop/windows form application, I have the following code that exists:
string[] excelFiles = Directory.GetFiles(strStartPath, "*ErrorReport*.xlsx")
.Select(path => Path.GetFileName(path))
.Where(x => !x.StartsWith("~")) //prevents files in alternate location from being selected
.ToArray();
I want to be able to look for files that say either "*ErrorReport*.xlsx" or ""*CustomerReport*.xlsx". However i
can not get this code to take any kind of a 'or' statement I give to.
Thus can you show me how to change the code so that it will look for either ErrorReport or CustomerReport?
Reply
Answers (
4
)
Import/Export Generic List Objects
Creating many objects of same class...