0

Hi,

I wonder what the way is to remove dublettes from a List. ?
I have filled a List like this:

List<String^>^ List1 = gcnew List<String^>();

List1->Add("123");
List1->Add("124");
List1->Add("123");
3
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by Darth Vader
0

You must be using old version of visual studio. The current version does not use pointers, but the ^ operator

List<String^>^ List1 = gnew List<String^>;
// etc

Upgrade to either 2008 or 2010 so that you can use newest version of C++/CLR language.

As for your question, probably do it like you would anything else. Iterate through the list to find duplicates and delete them when found. You would need two loops for that.

Edited by Ancient Dragon: n/a

0

Okay, I will check it out.
I understand how I can do it with 2 loops. I was just hoping for if there was any type of function for this etc.

Thanks for help!

You must be using old version of visual studio. The current version does not use pointers, but the ^ operator

List<String^>^ List1 = gnew List<String^>;
// etc

Upgrade to either 2008 or 2010 so that you can use newest version of C++/CLR language.

As for your question, probably do it like you would anything else. Iterate through the list to find duplicates and delete them when found. You would need two loops for that.

0

That is the std:: namespace and I doing the code in managed. Thanks.

How about std::set?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.