Skip to content

Instantly share code, notes, and snippets.

@ncarandini
Created March 29, 2020 18:57
Show Gist options
  • Save ncarandini/56fe734e604a49190deed39cd4b956d6 to your computer and use it in GitHub Desktop.
Save ncarandini/56fe734e604a49190deed39cd4b956d6 to your computer and use it in GitHub Desktop.
Solve the Giorgio Di Nardo quiz
void Main()
{
List<Item> items = new List<UserQuery.Item>
{
new Item { Id = 1, Nome = "Giorgio" },
new Item { Id = 1, Nome = "Luca" },
new Item { Id = 1, Nome = "Marco" },
new Item { Id = 1, Nome = "Nicolò" }
};
string[] elements = new string[] {"uc", "ni"};
var foundItems = items.Where(i => elements.Any(e => i.Nome.ToUpper().Contains(e.ToUpper())));
foundItems.Dump();
}
// Define other methods and classes here
public class Item
{
public int Id { get; set; }
public string Nome { get; set; }
}
@Akelitz
Copy link

Akelitz commented Mar 30, 2020

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment