title: Declare variable inside String.format in c#
body: <p>How can i declare a variable inside String.format and use it again like :</p>
  
  <pre><code>String.Format("{0} {1}", int t = 1, new string[] { "a", "b" }.ElementAt(t));
  </code></pre>
  
  <p><strong>update</strong><br>
  I just want to learn something new and type the code in one line.<br>
  It is not necessary in this case, but useful in others.  </p>
  
  <p><strong>update</strong><br>
  I found another solution :</p>
  
  <pre><code>int indx;
  var st = String.Format("{0} {1}", (indx=1), new string[] { "a", "b" }.ElementAt(indx));
  </code></pre>