forum

Home / DeveloperSection / Forums / Check array in an arraylist contains a certain value

Check array in an arraylist contains a certain value

Norman Reedus204629-Oct-2014
I have an array list which contains arrays of type String. I create the array list and add arrays to it with the following code:

List<String[]> transaction =new ArrayList<String[]>();
 
String[] transactionLine = newString[7];
transactionLine[0]= "0";
transactionLine[1]= "1";
//.....
transactionLine[6]= "some value";
 
transactionLines.add(transactionLine);

Now I want to test if one of the arrays contain a certain value. I tried it like this, but then it checks for an array and not an element of an array:

if(transactionLines.contains("some value")) { 
     //Do some
}



Updated on 29-Oct-2014

Can you answer this question?


Answer

1 Answers

Liked By