Link to home
Start Free TrialLog in
Avatar of cmdolcet
cmdolcetFlag for United States of America

asked on

how to check an arralist with individual Alphanumeric entries.

I want to search an arraylist of entries and if an entry is is there do not duplicate the entry and jsut move on. If the entry is new I want to add it to the arraylist.

If _ExcelGageID.startswith("L")  then
_ExcelArraylist.add(wirelessArray(1)
end if

Open in new window

Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

What kind of Object are stored in the ArrayList?
If not basic types such as integers, double, ... what is the object structure and what fields will determine equality?
Hi cmdolcet;

If using a basic data type such as integer then doing the following should do what you need.
Dim al As New ArrayList
'' ...
Dim itemToInset As Integer = 4

If Not al.Contains(itemToInset) Then
    al.Add(itemToInset)
End If

Open in new window

Avatar of cmdolcet

ASKER

Sorry just saw that. I am looking to add an alphanumeric number like "L12345" to the arraylist.
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial