title: Trying to convert a method from a string into an integer
body: <p>I'm writing a program that will count the amount of commas a string the user wrote contains.</p>
  
  <p>I'm doing this by using another method in which the written string gets analyzed and the amount of commas are returned.</p>
  
  <p>The problem I'm having is that I'm using a string, which needs to be  converted into an integer while sitting in a method, if that makes sense.</p>
  
  <p>I know this can be done easier by just removing the method and writing the code in the 'main', but I don't want to since I will be expanding the program to also analyze the amount of full stops and the amount of semicolons in the written string.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>static void Main(string[] args)
      {
          Console.WriteLine("Enter a text:");
          string text = Console.ReadLine();
          int count = 0;
          count = NumberOfCommas(text);
          int kommaCount = count;
  
  
          int NumberOfCommas(int text1)
          {
              foreach (char letter in text)
              {
                  if (letter == ',' )
                  {
                      count++;
                  }
              }
              return count;
          }
          Console.WriteLine("There's {0} comma(s) in your text.", kommaCount);
          Console.ReadKey();
      }
  </code></pre>
  
  <p>The error code I'm getting is "cannot convert from 'string' to 'int'. (the code is referencing to the 'text' part of this line: <code>count = NumberOfCommas(text);</code>)</p>
  
  <p>I hope I explained it well, so my question is: how do I fix this?</p>