Net Remove The Duplicate String Of A String Array
How to check duplicates in string array c#.Also show a message if duplicate present. Posted 14-Apr-13 21:37pm. So you'd probably want to remove punctuation characters from the original string, or remove them when adding them to either the hset and the duplicates collections. Lastly, punctuation in a sentence can obfuscate duplicate words, so you'd probably want to remove punctuation characters from the original string, or remove them when adding them to either the hset and the duplicates collections (in the example above).
I need some help figuring out how to remove duplicates from an array. I've been working on this for a few days now, and every time I think I'm getting close, it just causes my program to shut down.
I've gt a text file with city names in it and mileage distances between the cities. But the cities are listed more than once. So out of 4 cities, I currently have an array with 12 elements. I need to remove the duplicates.
I'm not asking for someone to write the code for me... Just a little help on how to go about ignoring/removing the duplicates, so that I can end up with an array of just 4 unique city names. I'm still pretty new at this, sorry if this is a really basic question.
Net Remove The Duplicate String Of A String Array Line
Thanks a lot, for any help!
-Charles...
- 3 Contributors
- forum5 Replies
- 393 Views
- 16 Hours Discussion Span
- commentLatest Postby VernonDozier
The easiest was is not to put the duplicates in the array in the first place. When you read a city name from the file check to see if the name is already in the array. If not, then add it.
|