Q: ArrayList

  • Thread starter Thread starter Geoff Jones
  • Start date Start date
G

Geoff Jones

Hi

I have an array list filled with integers. Is there an inbuilt function to
remove all identical items in this list e.g.

if the list is 8,3,5,6,6,7,8,1,2

then I want 8,3,5,6,1,2

Thanks in advance

Geoff
 
Geoff,

Not in the arraylist, the hashtable is made for this.
Otherwise looping, I thought I once sand a sample for that too this
newsgroup.

I hope this helps?

Cor
 
Hi

I have an array list filled with integers. Is there an inbuilt function to
remove all identical items in this list e.g.

if the list is 8,3,5,6,6,7,8,1,2

then I want 8,3,5,6,1,2

Thanks in advance

Geoff

hmmm...

You can use the ArrayList.Contains method before actually inserting the
value...


If Not myList.Contains (theValue) Then
myList.Add (theValue)
End If

HTH
 
Thanks Guys!

Tom Shelton said:
hmmm...

You can use the ArrayList.Contains method before actually inserting the
value...


If Not myList.Contains (theValue) Then
myList.Add (theValue)
End If

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top