I have a list of Dictionaries.
List<Dictionary<String, String>> data = GetData();
The dictionaries contain a key named “Month” with values like “1/2010” etc. I need a list of strings with all different months that appear in the Dictionary-list.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Simple with LINQ:
Or if not all of the dictionaries had the entry:
EDIT: My original version didn’t include the
Distinctcall, so it would have included duplicates. It now won’t.