arraylist contain

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

Hi, guys

Dim myAL As New ArrayList()
myAL.Add("Monday")
myAL.Add("Tuesday")
myAL.Add("Thursday")

I want to check whether the first 3rd letters of myAL contains "Thu". Is
there an existing function I missed, as myAL.Contains("Thu") returns me
false?

Thanks.
 
you missed nothing, what you are looking for doesn't exist
..Contains simply loops over the list and does a .equals on every object
you will need to do the same
loop over the arraylist and call .startswith on every string in the list...


hope this helps

dominique
 
Back
Top