title: Count occurrence of whole word in a string
body: <p>I want to find the number of occurrence of particular word in a string. </p>
  
  <p>I have searched online and found many answers like</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/3016522/count-the-number-of-times-a-string-appears-within-a-string">Stack Overflow Answer</a></li>
  <li><a href="http://www.dotnetperls.com/string-occurrence" rel="nofollow noreferrer">Answer from DotNetPerl</a></li>
  </ul>
  
  <p>But none of them gave me accurate result. </p>
  
  <p>What I want is: </p>
  
  <p>Input:</p>
  
  <pre><code>I have asked the question in StackOverflow. Therefore i can expect answer here.
  </code></pre>
  
  <p>Output for "The" keyword:</p>
  
  <pre><code>The keyword count: 2
  </code></pre>
  
  <p><strong>Note:</strong> It should not consider "The" from "Therefore" in a sentence. </p>
  
  <p>Basically I want to match whole word and get the count. </p>