I have an array of zip codes. How do I obtain a list of every unique zip code in the array, and then count how many times the unique zip code occurred in the array?
I saw this:
A method to count occurrences in a list
I have a hunch this is the solution to my problem, but I don’t really understand it. Can someone please tell me if this is
- indeed the best way to go about it. And
- show me how to put an array into a List so that I can take advantage of GroupBy?
This should work for you:
Should give you:
driis actually gets you most of the way there. I just posted this to help show how to enumerate the groups.