title: Occurrences of a substring in a string without using string functions
body: <p>I want to know how to count the occurrences of a particular sub-string in a string without using any of the built in JAVA string functions. For example:</p>
  
  <pre><code>InputString = "knowbutuknow"
  subString = "know"
  </code></pre>
  
  <p>The program should return the result as 2.</p>
  
  <p>EDIT: Re-phrased my question. This is one of those interview questions I came across.</p>
  
  <p>EDIT: Basic string functions like charAt and length can be used here.</p>