Avatar of cmdolcet
cmdolcet
Flag 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

Visual Basic.NET

Avatar of undefined
Last Comment
Fernando Soto

8/22/2022 - Mon
Fernando Soto

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?
Fernando Soto

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

cmdolcet

ASKER
Sorry just saw that. I am looking to add an alphanumeric number like "L12345" to the arraylist.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ASKER CERTIFIED SOLUTION
Fernando Soto

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.