I’m using streamreader now to read a file of people names, it is a text file, of people first names, so there are obviously duplicates, and i want to be able to display how many people have the same now so for example:
josh
alex
josh
john
alex
I want it to say,
josh 2
alex 2
john 1
but I can’t seem to find an easy way of doing this, what would be the easiest way about doing this,
I’d say use a
Dictionary<string, int>.Of course there are many different paths to a solution, but this is how I would tackle it. I haven’t run this code yet, but this will help you I think.