title: Check if String array contains word in another String Array
body: <p>Having trouble figuring out how to check if a word from one String Array is in another String Array.  This is what I have so far:</p>
  
  <pre><code>        FileInputStream fis = new FileInputStream("TranHistory.csv");
          InputStreamReader isr = new InputStreamReader(fis, "UTF-8");
          CSVReader reader = new CSVReader(isr);
  
          String[] groceries = new String[]{"albertsons", "costco"};
  
          for (String[] cols; (cols = reader.readNext()) != null;) {
              if(cols[4].toLowerCase().contains(groceries)){
                  System.out.print(cols[4]);
              }
  
          }
  </code></pre>
  
  <p>The above code is currently giving me an error because .contains() cannot be applied to String Array.  This only works if I change the if statement to this:</p>
  
  <pre><code>        if(cols[4].toLowerCase().contains("albertsons")){
                  System.out.print(cols[4]);
          }
  </code></pre>
  
  <p>My issue is that String[] groceries is going to have many grocery stores so I think comparing String[] col to String[] groceries is the most efficient way of doing this I'm just having trouble implementing it.</p>
  
  <p>SOLUTION:</p>
  
  <p>I figured it out... you have to do a nested for loop.  This is what I did:</p>
  
  <pre><code>String[] groceries = {"albertsons", "costco"};
  
  for (String[] cols; (cols = reader.readNext()) != null;) {
        for (int i = 0; i &lt; groceries.length; i++){
  
            if(cols[4].toLowerCase().contains(groceries[i]))
               {
                   System.out.print(cols[4]);
                   }
  
             }
        }
  </code></pre>