N
nemadrias
Hi -
I was using two arrays to go through two lists of numbers in the same
format, such as below:
The numbers are always 15 numbers followed by some text. I ONLY care
about the first 15 numbers, not the text.
100121242110124ABC 000121241000124ABC
000121236300124ABC 000121236300124ABC
005151533414124ABC 001121231009909ABC
000124576700188ABC 123516800785656ABC
I had passed both sets of numbers into two separate arrays, and was
able to use the regionMatches method to compare the first 15 numbers to
find duplicates. I want to be able to remove any duplicates from the
first array so I can return only the unique numbers from the first list
(left side). Unfortunately, arrays don't have a "removeAtIndex" method
while Vectors DO have the ability to remove from the vector array. So
I tried vectors...But, Vectors can't use the method regionMatches which
allows me to check those first 15 numbers...
Can ANYONE help me with this problem which has been plaguing me for
hours now? Thanks in advance: I can definitely provide more info. if
needed. THANKS!!
Steve
--Sample of code below with Vectors (which can't use the regionMatches
method)
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
if
(myVector.elementAt(i).regionMatches(0,myVector2.elementAt(j),0,15)){
myVector.removeElementAt(i);
}
else {
//Do nothing
}
}
I was using two arrays to go through two lists of numbers in the same
format, such as below:
The numbers are always 15 numbers followed by some text. I ONLY care
about the first 15 numbers, not the text.
100121242110124ABC 000121241000124ABC
000121236300124ABC 000121236300124ABC
005151533414124ABC 001121231009909ABC
000124576700188ABC 123516800785656ABC
I had passed both sets of numbers into two separate arrays, and was
able to use the regionMatches method to compare the first 15 numbers to
find duplicates. I want to be able to remove any duplicates from the
first array so I can return only the unique numbers from the first list
(left side). Unfortunately, arrays don't have a "removeAtIndex" method
while Vectors DO have the ability to remove from the vector array. So
I tried vectors...But, Vectors can't use the method regionMatches which
allows me to check those first 15 numbers...
Can ANYONE help me with this problem which has been plaguing me for
hours now? Thanks in advance: I can definitely provide more info. if
needed. THANKS!!
Steve
--Sample of code below with Vectors (which can't use the regionMatches
method)
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
if
(myVector.elementAt(i).regionMatches(0,myVector2.elementAt(j),0,15)){
myVector.removeElementAt(i);
}
else {
//Do nothing
}
}