title: Swift 3 String Contains Exact Sentence / Word
body: <p>I would like to know a simple algorithm to determine if a string contains exact sentence or word.</p>
  
  <p><strong>I'm not looking for:</strong></p>
  
  <p><code>string.contains(anotherString)</code></p>
  
  <p>Here's why:</p>
  
  <pre><code>let string = "I know your name"
  string.contains("you") // Will return true
  </code></pre>
  
  <p>In the example above, it returns true because if find <code>"you"</code> in the word <code>"your"</code>. I want a method  that will return false in that condition.</p>
  
  <p><strong>For example:</strong></p>
  
  <pre><code>let string = "I am learning Swift"
  
  // Let's say we make a method using extension called contains(exact:)
  string.contains(exact: "learn") // return false
  </code></pre>
  
  <p>The method <code>contains(exact:)</code> will return false since <code>"learn"</code> is not equal with <code>"learning"</code></p>
  
  <p><strong>Another example:</strong></p>
  
  <pre><code>let string = "Healthy low carb diets"
  string.contains(exact: "low carb diet") // return false
  </code></pre>
  
  <p>What's the algorithm to get that result in Swift 3? Or is there predefined method for this?</p>