using System.Collections.Generic;
using System.Text.RegularExpressions;
public static void Main()
var states = new List<State>()
{new State("CA", "California"), new State("NY", "New York"), new State("AL", "Alabama"), new State("NV", "Nevada")};
var myOrder = new List<string>()
var result = states.Where(s => myOrder.Exists(c => string.Equals(c, s.Code, StringComparison.OrdinalIgnoreCase))).OrderBy(s => myOrder.IndexOf(s.Code));
foreach (var res in result)
Console.WriteLine(res.Code);
public State(string code, string name)