Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
List Compare and print - Except
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { List<int> first = new List<int>(); first.Add(1); first.Add(2); first.Add(3); first.Add(7); List<int> second = new List<int>(); second.Add(2); second.Add(3); second.Add(5); second.Add(7); List<int> firstNotSecond = first.Except(second).ToList(); List<int> secondNotFirst = second.Except(first).ToList(); Console.WriteLine(firstNotSecond.Count); foreach (int i in firstNotSecond) { Console.WriteLine("List Items in firstNotSecond {0}", i); } Console.WriteLine(secondNotFirst.Count); foreach (int i in secondNotFirst) { Console.WriteLine("List Items in secondNotFirst {0}", i); } } } }
run
|
edit
|
history
|
help
0
RomaSlot2
Using System.Reflection to find Property Name and Value of any Generic class
code exple
1
Fórum Group Data Within 5 Hours Maximum
tablecsv
pyramidalt
stackoverflow_25444818
Just tries to add/remove items to the list
Unsorted Parallel Arrays finding min & max values.