title: Foreach Loop Checking For a Specific Character C#
body: <p>This is a really basic question but for whatever reason I can't figure this out.
  The program is returning</p>
  
  <blockquote>
    <p>Error 1   Type and identifier are both required in a foreach statement</p>
  </blockquote>
  
  <pre><code>int i = 0;
  char g = '.';
  char s1 = '!';
  char s2 = '?';
  
  foreach(g in textBox1.Text)
  {
     i++;
  }
  </code></pre>
  
  <p>I know I repeated a variable I am trying to get g to be define as something for example to explain I will put the code to everyday language below</p>
  
  <pre><code>foreach(Period in textBox1.Text)
  {
     i++;
  }
  </code></pre>
  
  <p>//Answer there are 3 sentences in textbox 1</p>