title: How do I count the number of occurrences of a charSequence in a String in Groovy
body: <p>For Example if this is my equation string,</p>
  
  <pre><code>IF(AND(x&gt;0,x&lt;100),5,IF(AND(x&gt;101,x&lt;200),6,10))
  </code></pre>
  
  <p>I want to count the no:of occurrences of "IF(" string in the equation.</p>