title: Find specific line that match certain array of keyword by using line.contains()
body: <p>I have some problem. Here, I want to use string[] inside the line.contains(), previously I try one code, if  I put line.contains(String), it do read the keywords, but I just can enter one keyword at a time. So, I try to group the keyword in an array but the main problem is line.contains() cannot read String[].</p>
  
  <p>Here is the code :-</p>
  
  <pre><code>package components;
  
  import java.io.File;
  import java.io.FileNotFoundException;
  import java.util.Scanner;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  
  public class matchWord {
  
      public static void main(String[] args) {
          File file = new File("file.txt");
          String[] errorType = {"uuid=A5H50AV_promo1, for domain=null", "Start node"};
          Scanner scanner = null;
          try {
              scanner = new Scanner(file);
          } catch (FileNotFoundException ex) {
              System.out.println("File not found");
          }
  
          int count = 0;
          //now read the file line by line
          for (int i = 0; i &lt; errorType.length; i++) {
              while (scanner.hasNextLine()) {
                  String line = scanner.nextLine();
                  //it doesn't read the errorType[i] as i can see that the count=0
                  if (line.contains(errorType[i])) {
                      count++;
                      if (count == 1) {
                          System.out.println("Error Description :" + line);
                      }
                  }
              }
          }
  
          System.out.println("Error Type : " + errorType + "\nCount : " + count);
          scanner.close();
      }
  }
  </code></pre>
  
  <p>Someone please help, thanks a lot.</p>