How can we find sequence of items in two different array (same type) in the same order using linq query?
Answer / Pankaj Kumar Bola
{"C# LINQ example for finding a sequence of items in two arrays with the same type and in the same order:n```csharpnint[] array1 = { 1, 2, 3, 4, 5 }; // sample array 1nint[] array2 = { 1, 2, 3 }; // sample array 2nvar commonElements = array1.Intersect(array2); // using the Intersect method to find common elementsnforeach (int element in commonElements) {nConsole.WriteLine(element);n}n```}
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the difference between linq to sql and entity framework?
What do you understand by linq to xml?
What is LINQPad?
What is the query syntax?
What do you understand by expression tree?
How Expressions Trees are different from Lambda Expression?
What does linq stand for?
Explain linq lambda expression with example?
Differentiate between select() and selectmany() method in linq.
What is linq in c# with example?
Enlist the advantages of linq?
In Linq Query why from clause come first as select statment ?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)