#

WE ARE SHARING

OUR EXPERIANCE.

BELIEVE THE POWER OF SHARE

BLOG

C # Linq "Except" Command To Get Directory Aware

C # Linq "Except" Command To Get Directory Aware

With C # Linq, it is possible to find the first array in two different arrays and not the different values ​​in the second array. This example is also the first string, a new string containing the second non-string values ​​is created and the values ​​are written on the screen.

public void Linq() 

    int[] numbersA = { 0245689 }; 
    int[] numbersB = { 13578 }; 
  
    IEnumerable<int> aOnlyNumbers = numbersA.Except(numbersB); 
  
    Console.WriteLine("Numbers in first array but not second array:"); 
    foreach (var n in aOnlyNumbers) 
    {          Console.WriteLine(n); 
    } 
}
Output;

Numbers in first array but not second array:
0
2
4
6
9