Get index of Enumerator.Current in C#
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/43021/c-get-index-of-current-foreach-iteration">(C#) Get index of current foreach iteration</a>  </p>
</blockquote>



<p>Good morning,</p>

<p>Is there any way I can get the index of an <code>Enumerator</code>'s current element (in the case, a character in a string) without using an ancillary variable? I know this would perhaps be easier if I used a <code>while</code> or <code>for</code> cicle, but looping through a string using an enumerator is more elegant... The only drawback for the case is that I really need to get each character's current index.</p>

<p>Thank you very much.</p>
