c# - Filtering one List<string> from another via LINQ -


I have a master list of colors:

  list & lt; String & gt; Complete list = new list & lt; String & gt; {"Red", "blue", "green", "purple"};  

I am on the list of existing colors of a product

  list & lt; String & gt; Real collar = new list & lt; String & gt; {"Blue", "red", "green"};  

How can I get a list back in the order of the complete list? (Red, blue, green)

  var ordered = full list. Colour);  

If that does not work, then do this

var ordered = real collar. Difference (full list);

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -