title: How to count number of occurrences of a certain char in string?
body: <p>How can I count the number of occurrences of a certain character in a string in Delphi?</p>
  
  <p>For instance, assume that I have the following string and would like to count the number of commas in it:</p>
  
  <pre><code>S := '1,2,3';
  </code></pre>
  
  <p>Then I would like to obtain <code>2</code> as the result.</p>