title: Looping through characters in a string in VB.NET
body: <p>I'm busy working on past exam papers in preparation for a Visual Basic exam. I need help with the following question which I'm stuck with. </p>
  
  <blockquote>
    <p>Write a function procedure to calculate the number of times the characters "e", "f" and "g" appears in a string</p>
  </blockquote>
  
  <p>I tried to write the psuedo code and came up with the following.</p>
  
  <pre><code>Loop through each individual character in the string
  If the character = "e","f" or "g" add 1 to number of characters
  Exit loop 
  Display total in messagebox
  </code></pre>
  
  <p>How do I loop through individual characters in a string (using a <code>for</code> loop) and how do I count the number of times a specific character appears in a string?</p>