omment collapse" id="comment-func-enumerate"><div class="p">
    <p>Returns a lazy <code>SequenceType</code> containing pairs (<em>n</em>, <em>x</em>), where
<em>n</em>s are consecutive <code>Int</code>s starting at zero, and <em>x</em>s are
the elements of <code>base</code>:</p>

<pre><code class="language-swift">&gt; for (n, c) in &quot;Swift&quot;.characters.enumerate() {
    print(&quot;\(n): &#39;\(c)&#39;&quot;)
  }
0: &#39;S&#39;
1: &#39;w&#39;
2: &#39;i&#39;
3: &#39;f&#39;
4: &#39;t&#39;</code></pre