I develop up the ItemList array with the above program code. How perform i remove any duplicates in this array?
Jul 12, 2013 Well, first put the strings you find into an array, see if that helps. You're building up a long string, that won't make it easy to find or remove the duplicates. Uses a LINQ statement to remove duplicate items from a string array but. NET I developed solutions using Borland Delphi and before Delphi.
BeginnerNewbie
6 Solutions
SaurabhSaurabh
You'd declare some array (or List, or whatever selection you may prefer) and would do something like:
Then you could make use of LINQ:
And after that, iterate the array and perform whatever you need.
EDIT: Much better what Srinivasan stated, check whether the product exists, and if it doesn't add it. To verify for it, you can use Exists. Or if using something like a Checklist, Contains.
NeverbirthNeverbirth
Rather than looking at and removing the duplicate elements you can check out whether it will be in the array, if it doesn't can be found you can add to array, else do nothing at all.
Declare a
Listlt;stringgt;
item called for instancechecklist
. In the cycle:SrinivasanSrinivasan
dhineshdhinesh
I just saw this, I attempted the subsequent code ; it functions great, I'michael making use of a CheckedListBox to view outcomes.There 2 arraylist used. 'Darray' keeping the initial listing of replicated strings. Then, 'FinArray' to get rid of the non-duplicated strings, then display the 'FinArray' items in the listbox:
user3144575consumer3144575
Dorababu MekaDorababu Meka