Skip to content

Instantly share code, notes, and snippets.

@leonardopinho
Last active December 30, 2019 15:08
Show Gist options
  • Save leonardopinho/8a0ff3390d914c9f7ccde0263eaa9bf7 to your computer and use it in GitHub Desktop.
Save leonardopinho/8a0ff3390d914c9f7ccde0263eaa9bf7 to your computer and use it in GitHub Desktop.
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