title: Java- how to parse for words in a string for a specific word
body: <p>How would I parse for the word "hi" in the sentence "hi, how are you?"
   or in parse for the word "how" in "how are you?"?</p>
  
  <p>example of what I want in code:</p>
  
  <pre><code>String word = "hi";
  String word2 = "how";
  Scanner scan = new Scanner(System.in).useDelimiter("\n");
  String s = scan.nextLine();
  if(s.equals(word)) {
  System.out.println("Hey");
  }
  if(s.equals(word2)) {
  System.out.println("Hey");
  }
  </code></pre>