I have a list of arrays
[Type 1970, Type 1981, Type 1985, Type 1999]
[Type 1985, Type 1970, Type 1985, Type 1999]
[Type 1999, Type 1981, Type 1985, Type 1970]
[Type 1981, Type 1985, Type 1999, Type 1970]
[Type 1985, Type 1970, Type 1981, Type 1999]
I would like to split up these arrays while only pulling a specific model type such as "Type 1999" and providing a count.
This is what I have came up with so far:
int counter = 0
for(int i = 0; i < listOfTypes.length; i++){
String[] typesSearch = listOfTypes[i]
if(typesSearch != null) {
if(typesSearch.equals("Type 1999")); {
counter++;
}
}
Ideally the output would be a new array with only a certain element
{Type 1999, Type 1999, Type 1999, Type 1999} and so forth
I think from here I can just use the length() to get a count of the elements inside this newly created array
typesSearch.equals("Type 1999")will always returnfalsebecause one of them is aString[]and the other is aString. They can never be equal.