How to set an arbitrary limit on a foreach loop?
<p>I've got a <code>foreach</code> loop fetches everything, but I want it to stop after 10. It appears that I should use <code>for</code> instead. But I don't understand how to write that while still assigning the required var.</p>

<pre><code>    @foreach (var p in posts)
{ 
        &lt;item&gt;
                &lt;title&gt;@p.GetProperty("zContentTitle").Value&lt;/title&gt;
                &lt;dc:creator&gt;@p.GetProperty("zPostAuthor").Value&lt;/dc:creator&gt;
                &lt;category&gt;@p.GetProperty("zPostCategories")&lt;/category&gt;
                &lt;description&gt;@p.GetProperty("zContentBody").Value.StripHtml().Trim()&lt;/description&gt;
                &lt;link&gt;http://@Request.Url.Host@landing.Url@p.Url&lt;/link&gt;
                &lt;guid isPermaLink="false"&gt;http://@Request.Url.Host@landing.Url@p.Url&lt;/guid&gt;
                &lt;pubDate&gt;@p.GetProperty("zPostDate").Value.FormatDateTime("ddd, dd MMM yyyy HH:mm:ss") CST&lt;/pubDate&gt;
        &lt;/item&gt;
}
</code></pre>
