<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>ArraysLesson: ForEach Loop</title>
		<link>http://rbwhitaker.wikidot.com/forum/t-620771/arrayslesson:foreach-loop</link>
		<description>Posts in the discussion thread &quot;ArraysLesson: ForEach Loop&quot; - Found a way to see Index without having to use For loop.</description>
				<copyright></copyright>
		<lastBuildDate>Fri, 06 Mar 2026 11:03:24 +0000</lastBuildDate>
		
					<item>
				<guid>http://rbwhitaker.wikidot.com/forum/t-620771#post-1699927</guid>
				<title>ArraysLesson: ForEach Loop</title>
				<link>http://rbwhitaker.wikidot.com/forum/t-620771/arrayslesson:foreach-loop#post-1699927</link>
				<description></description>
				<pubDate>Thu, 31 Jan 2013 20:25:52 +0000</pubDate>
				<wikidot:authorName>Sorthious</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>You said:</p> <blockquote> <p>&#8230;inside of the loop, you have no way of knowing what index, specifically, you are currently at&#8230;.</p> </blockquote> <p>There is an easy way to see what Index# your at within the ForEach loop&#8230;.I used your HighScore example and bumped it up to start at 1 instead of 0(which is the first Index #)</p> <div class="code"> <pre><code>int scoreNumber = 1; int[] scores = { 50, 100, 12000, 3322, 500, 345, 9990, 256, 1144, 769 }; foreach (int score in scores) { Console.WriteLine(&quot;HighScore #{0} = &quot; + score,scoreNumber); scoreNumber++; }</code></pre></div> <p>pretty simple (^8</p> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>