Last active
December 30, 2019 15:08
-
-
Save leonardopinho/8a0ff3390d914c9f7ccde0263eaa9bf7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
var range = new List<int>(){1, 2, 3, 4}; | |
var range2 = new List<int>(){2, 3}; | |
var result = range.Where(n => !range2.Any(n2 => n2 == n)).ToList(); | |
var str = String.Join(", ", ((result as List<int>).OrderBy(x => x).ToList())); | |
Console.WriteLine("{0}", str); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment