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

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -