title: accessing variable outside for loop
body: <p>how to access a string assigned some value in a for loop, outside the for loop
  i may provide you with the code for thy convenience</p>
  
  <pre><code>for (Int32 i = 0; i &lt; yourlist.Count; i++)
      {
          String str=(yourlist[i].ToString() + ",");
      }
  
      String str1 = (str).Substring(0, str.Length - 1);
  </code></pre>
  
  <p>the error displayed is</p>
  
  <blockquote>
    <p>The name 'str' does not exist in the current context </p>
  </blockquote>