title: Java: String.contains matches exact word
body: <p>In Java</p>
  
  <pre><code>String term = "search engines"
  String subterm_1 = "engine"
  String subterm_2 = "engines"
  </code></pre>
  
  <p>If I do <code>term.contains(subterm_1)</code> it returns <code>true</code>. I don't want that. I want the <code>subterm</code> to exactly match one of the words in <code>term</code></p>
  
  <p>Therefore something like <code>term.contains(subterm_1)</code> returns <code>false</code> and <code>term.contains(subterm_2)</code> returns <code>true</code></p>