title: C# Counting the number of upper and lower case letters in a string
body: <p>Hi I've been asked to do a task which calculates the number of vowels, consonants, upper and lower case letters in a string.</p>
  
  <p>I'm having trouble working out upper and lower case letters in a string.
  I can successfully count the number of vowels and constants but upper and lower case letters seems to be a pain.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>    public void Calculate()
      {
          foreach(string sentence in sentenceList)
          {
              sentences++;
  
              for (int i = 0; i &lt; sentence.Length; i++)
              {
                  if (vowelsArray.Contains(sentence[i]))
                  {
                      vowels++;
                  }
                  else if (consonantsArray.Contains(sentence[i]))
                  {
                      consonants++;
                  }
                  else if (char.IsUpper(sentence[i]))
                  {
                      upperCaseLetters++;
                  }
                  else if (char.IsLower(sentence[i]))
                  {
                      lowerCaseLetters++;
                  }
              }
          }
      }
  </code></pre>
  
  <p>The value for the upper and lower case letters is 0. (It shouldn't be)</p>
  
  <p>Any suggestions? Thanks!</p>