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
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
How To Apply Filter In List By Another List
Jitendra Kumar
Aug 12
2016
Code
5.5
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
using
System;
using
System.Collections.Generic;
using
System.Linq;
namespace
filterInlistusingAnotherList
{
class
Program
{
public
static
void
Main(
string
[] args)
{
List<
string
> City1 =
new
List<
string
> {
"Agra"
,
"Noida"
};
List<
string
> City2 =
new
List<
string
> {
"Delhi"
,
"Agra"
,
"Noida"
,
"Ghaziabad"
};
City2.Where(x => City1.Count(y => x.Contains(y)) == 0).ToList<
string
>().ForEach(x => Console.WriteLine(x));
Console.ReadKey();
}
}
}
Another List
Apply Filter In List
C#