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
Jay S
NA
230
59.4k
Quickest Loop within a Loop
Sep 9 2014 11:48 AM
Currently I have a Loop with in a Loop to find if sometime in a List is contained within a string array:
foreach (var cl in compFileName)
{
foreach (var f in fileArray)
{
if (f.Contains(cl))
{
compToCopy.Add(f);
}
}
(sender as BackgroundWorker).ReportProgress(i, Convert.ToString(i));
i++;
I'm wondering if there is a more efficient way rather than doing a loop within a loop as even with just 30,000 in the list it takes some time to iterate through!
Reply
Answers (
2
)
C# update active directory groups
Logic for this operation