0

I'm probably just overcomplicating things...

Both of the arrays I'm using are arrayLists, what I'm trying to do is, most/all of array1 will be in array2, array1 however holds 5 digits strings and array2 (also strings) has a longer string which possibly starts with the first 5 digits of array1.

So if that makes sense, what I'm trying to do is using array1's each string, searching array2 for it and when found, I want the whole string, and I'm going to create a new arraylist for those.

I'm not sure what's slipping me up! .Contains seems to not find anything in array2, even though array1 has say "00111" and array2 has "00111, FIND for 8043890132", I'm guessing that's because it's looking for exactly "00111"?

      For Each unfoundLo In arrUnfoundInLo           

                 If arrCorList.IndexOf(unfoundLo) Then      '
4

1 回答 1

1

我不确定我所看到的,但我假设你只做一个循环。

你必须在两个数组中循环

For Each item1 In array1
    For Each item2 In array2
        If item2.Contains(item1) Then

或者循环数组二,得到数字部分

For Each item2 In array2
    numberPart = item2.SubString(0, 5)

    If array1.Contains(numberPart) Then

* 这些是示例,不是实际使用的代码

于 2013-04-17T17:07:31.657 回答