title: Number of occurrences of a character in a string
body: <p>I am trying to get the number of occurrences of a certain character such as <code>&amp;</code> in the following string.</p>
  
  <pre><code>string test = "key1=value1&amp;key2=value2&amp;key3=value3";
  </code></pre>
  
  <p>How do I determine that there are 2 ampersands (&amp;) in the above test string variable?</p>