title: goto statement in C#
body: <p>I'm writing a function like in C#:</p>
  
  <pre><code>public void CountNumber() 
  {
         for(int i = 0; i &lt; 40; i++) {
            if(i &gt; 20) {
                 goto out1;
            }
  
            Console.WriteLine("hello " + 1);
  
            out1:
               string hello = "";
         }
  }
  </code></pre>
  
  <p>This basically counts the number and if the i is greater than 20 it should not write to console.writeline. it should step over and hit "out1" but the "out1" needs to have a function in the end to compile. It needs to have "string hello = """ to compile. I don't need the "string hello = """. I just want it to do nothing and got the end of the loop. Is there a way to do this without the "string hello = """ that the out1: statement needs? Like:</p>
  
  <pre><code>public void CountNumber() 
  {
         for(int i = 0; i &lt; 40; i++) {
            if(i &gt; 20) {
                 goto out1;
            }
  
            Console.WriteLine("hello " + 1);
  
            out1:
         }
  }
  </code></pre>
  
  <p>Thanks.</p>