Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

difference two list c#

var list1 = new List<int> { 1, 2, 3, 4, 5};
var list2 = new List<int> { 3, 4, 5, 6, 7 };

var list3 = list1.Except(list2); //list3 contains only 1, 2
var list4 = list2.Except(list1); //list4 contains only 6, 7
var resultList = list3.Concat(list4).ToList(); //resultList contains 1, 2, 6, 7
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity set mouse 
Csharp :: c# distinct by property 
Csharp :: c# add char to string 
Csharp :: how to verify the scene unity 
Csharp :: if number negative c sharp 
Csharp :: C# get md5 of file 
Csharp :: c# move files from one folder to another 
Csharp :: unity event 
Csharp :: int to bool c# 
Csharp :: c# insert character into string at position 
Csharp :: ngrok for https 
Csharp :: contains char c# 
Csharp :: can you have multiple statement in a case c# 
Csharp :: c# create dynamic json 
Csharp :: unity get parent object 
Csharp :: How to take input on float in c# 
Csharp :: unity 3d camera movement script 
Csharp :: play animation through script unity 
Csharp :: how to stop animation unity 
Csharp :: c# write to output window 
Csharp :: how to duplicate a clip in premiere pro 
Csharp :: linq get a dictionary key and value c# 
Csharp :: c# datagridview rows clear not working 
Csharp :: C# loop through array of objet 
Csharp :: declare dictionary c# 
Csharp :: difference between boxing and unboxing in java 
Csharp :: how to get total scenes unity 
Csharp :: c# find value in datagridview 
Csharp :: c# convert dictionary object to string 
Csharp :: c# struct 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =