<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: C# foreach howto.</title>
	<atom:link href="http://www.developingfor.net/net/c-foreach-howto.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.developingfor.net/net/c-foreach-howto.html</link>
	<description>Real World .NET Methods, Tricks, and Examples</description>
	<lastBuildDate>Sat, 31 Jul 2010 00:54:16 -0400</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Joel</title>
		<link>http://www.developingfor.net/net/c-foreach-howto.html/comment-page-1#comment-3</link>
		<dc:creator>Joel</dc:creator>
		<pubDate>Tue, 16 Jan 2007 17:47:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.developingfor.net/net/c-foreach-howto.html#comment-3</guid>
		<description>I will gladly ramble a bit though!  foreach is a great approach in many cases, and is definitely easier to read.  And you can use break; to leave the foreach loop at any time.  If you need to process the index number of an element, it is not the right choice, the old for is still the best for that, but most of the time that is not the case and foreach is a preferred replacement in my book.

To really get the most out of it, you must understand that it feeds off of an IEnumerable implementation.  Anything that implements an IEnumerable interface can be used in a foreach statement, which means you can write your own class members that will also be consumable by foreach.</description>
		<content:encoded><![CDATA[<p>I will gladly ramble a bit though!  foreach is a great approach in many cases, and is definitely easier to read.  And you can use break; to leave the foreach loop at any time.  If you need to process the index number of an element, it is not the right choice, the old for is still the best for that, but most of the time that is not the case and foreach is a preferred replacement in my book.</p>
<p>To really get the most out of it, you must understand that it feeds off of an IEnumerable implementation.  Anything that implements an IEnumerable interface can be used in a foreach statement, which means you can write your own class members that will also be consumable by foreach.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
