Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
SequenceEqual LINQ Method
WhatsApp
Nemilidinne Ashokreddy
Jan 09
2016
1.5
k
0
0
using
System;
using
System.Linq;
namespace
ConsoleApplication1
{
class
Program
{
static
void
Main(
string
[] args)
{
string
[] names1 = {
"sample1"
,
"sample1"
,
"sample1"
};
string
[] names2 = {
"sample1"
,
"sample1"
,
"sample1"
};
string
[] names3 = {
"sample1"
,
"sample1"
,
"sample1"
};
bool
result =
new
[]
{
names2,
names1
}.All(names1.SequenceEqual);
Console.WriteLine(result);
Console.ReadLine();
}
}
}
Linq
SequenceEqual method in LINQ
Check equality of more than 2 collections
Up Next
SequenceEqual LINQ Method